javapythonjvmheap-memorypy4j

How to increase heap space for a Python library based on Java?


I'm a Python user and I'm struggling with a java-based library (lolopy, https://pypi.org/project/lolopy/). In particular, I should increase the heap space following what the authors say in the documentation:

"Setting the maximum memory footprint for the JVM running the machine learning calculations can be achieved by setting the LOLOPY_JVM_MEMORY environment variable. The value for LOLOPY_JVM_MEMORY is used to set the maximum heap size for the JVM (see Oracle’s documentation for details). For example, “4g” allows lolo to use 4GB of memory".

Having never used Java, I have no idea what to do. Thanks in advance.


Solution

  • Just add a new env variable:

    Name: LOLOPY_JVM_MEMORY

    Value: 4g (or any other value you need)

    Here is simple manual how to do it if you don't know. Just change PATH to LOLOPY_JVM_MEMORY: https://www.java.com/en/download/help/path.xml

    But it has nothing with Java. It just a simple environment variable

    [EDIT]

    Ok, this tutorial is much better: https://www.poftut.com/how-to-set-environment-variables-for-linux-windows-bsd-and-macosx/