sync_reasoner: Could not reserve enough space for 2048000KB object heap

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sync_reasoner: Could not reserve enough space for 2048000KB object heap

Caitlin
Hi there,

I am trying to use sync_reasoner in owlready2 however, I'm getting the following error:

owlready2.base.OwlReadyJavaError: Java error message is:
Error occurred during initialization of VM
Could not reserve enough space for 2048000KB object heap

Any help would be appreciated.

Kind Regards,
Caitlin
Reply | Threaded
Open this post in threaded view
|

Re: sync_reasoner: Could not reserve enough space for 2048000KB object heap

Jiba
Administrator
Hi,

This corresponds to the memory allocated for the Java virtual machine. If you do not have enough memory, you need to lower the value. This can be done by editing manually reasoning.py and modifying "-Xmx2000M" by a lower value, e.g. "-Xm500M".

In the development version of Owlready, I've just added the owlready2.reasoning.JAVA_MEMORY global variable that allows to modify the value without having to edit the source code.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: sync_reasoner: Could not reserve enough space for 2048000KB object heap

khaoula
salut
j'ai le même problème et j'ai pas compris comment le résoudre.
j'ai créée les réglés dans protégé et je vais faire le raisonnement avec python mais je sais pas comment ça marche.
est ce qu'il y a une solution ?
merci d'avance.
Reply | Threaded
Open this post in threaded view
|

Re: sync_reasoner: Could not reserve enough space for 2048000KB object heap

khaoula
In reply to this post by Jiba
salut
lorsque j'exécute sync_reasoner() le message d'erreur suivant est afficher :
* Owlready2 * Running HermiT...
    java -Xmx2000M -cp C:\Python\Python37\lib\site-packages\owlready2\hermit;C:\Python\Python37\lib\site-packages\owlready2\hermit\HermiT.jar org.semanticweb.HermiT.cli.CommandLine -c -O -D -I file:///C:/Users/Khaoula/AppData/Local/Temp/tmptto_zvjn
Traceback (most recent call last):
  File "C:\Python\Python37\lib\site-packages\owlready2\reasoning.py", line 136, in sync_reasoner_hermit
    output = subprocess.check_output(command, stderr = subprocess.STDOUT)
  File "C:\Python\Python37\lib\subprocess.py", line 376, in check_output
    **kwargs).stdout
  File "C:\Python\Python37\lib\subprocess.py", line 468, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['java', '-Xmx2000M', '-cp', 'C:\\Python\\Python37\\lib\\site-packages\\owlready2\\hermit;C:\\Python\\Python37\\lib\\site-packages\\owlready2\\hermit\\HermiT.jar', 'org.semanticweb.HermiT.cli.CommandLine', '-c', '-O', '-D', '-I', 'file:///C:/Users/Khaoula/AppData/Local/Temp/tmptto_zvjn']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Khaoula/PycharmProject/cv/cv.py", line 9, in <module>
    sync_reasoner()
  File "C:\Python\Python37\lib\site-packages\owlready2\reasoning.py", line 141, in sync_reasoner_hermit
    raise OwlReadyJavaError("Java error message is:\n%s" % (e.stderr or e.output or b"").decode("utf8"))
owlready2.base.OwlReadyJavaError: Java error message is:
Error occurred during initialization of VM
Could not reserve enough space for 2048000KB object heap


Process finished with exit code 1


Reply | Threaded
Open this post in threaded view
|

Re: sync_reasoner: Could not reserve enough space for 2048000KB object heap

Jiba
Administrator
Salut,

La variable owlready2.reasoning.JAVA_MEMORY permet de régler la mémoire allouée en Java, par exemple :

owlready2.reasoning.JAVA_MEMORY = 4000

pour en allouer davantage (par défaut, c'est 2000 ko).

Jiba