Saturday 12 August 2023

Tabula-py: Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full

I installed both the tabula-py library and also Java to try and scrape tables from PDFs. I ran some simple code below with a sample pdf I found online:

from tabula import read_pdf

path = "https://sedl.org/afterschool/toolkits/science/pdf/ast_sci_data_tables_sample.pdf"

table = read_pdf(path,pages=1) 
print(table[0])

I got the following error(s):

Got stderr: Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full. Compiler has been disabled.
Java HotSpot(TM) 64-Bit Server VM warning: Try increasing the code cache size using -XX:ReservedCodeCacheSize=

Traceback (most recent call last):
  File "/Users/default/Desktop/Schedule Data/Extraction.py", line 21, in <module>
    tables = tabula.read_pdf('Brunswick Student Proof 1.pdf',pages = [14,20])
  File "/Users/default/Library/Python/3.9/lib/python/site-packages/tabula/io.py", line 440, in read_pdf
    raw_json: List[Any] = json.loads(output.decode(encoding))
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I have searched for a potential fix to either the codecache error or the JSON decoder error, and the answers have not been very helpful, is the issue here with the Java end or the tabula library or both?



from Tabula-py: Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is full

No comments:

Post a Comment