I have this function to read a doc file using tika on linux:
def read_doc(doc_path):
output_path=doc_path+'.txt'
java_path='/home/jdk1.7.0_17/jre/bin/'
environ = os.environ.copy()
environ['JAVA_HOME'] =java_path
environ['PATH'] =java_path
tika_path=java_path+'tika-app-1.3.jar'
shell_command='java -jar %s --text --encoding=utf-8 "%s" >"%s"'%(tika_path,doc_path,output_path)
proc=subprocess.Popen(shell_command,shell=True, env=environ,cwd=java_path)
proc.wait()
This function works fine when I run it from the command line, but when I call the same function using CGI, I get the following error:
Error occurred during initialization of VM Could not reserve enough space for object heap
I checked previous answers for this particular error and they suggest increasing the memory, but this doesn't seem to work...I don't think this has to do with memory allocation, but rather some read/write/execute privilages from the cgi script, any idea how to solve this problem?