When you run a Java application, there is usually a fixed maximum amount of memory which is available. This is usually 64 megabytes of memory.
So if you run a java program from the command line like this, the program can use a maximum of 64 megabytes of memory (this is the default).
java -jar jpedal.jar
Sometimes, you need more memory. So there is a useful Java option (-Xmx) to increase the maximum memory available. The format is slightly fiddly so best shown with an example which tells Java to use a maximum memory of 128 megabytes instead
java -Xmx128M -jar jpedal.jar
The number value comes straight after the -Xmx flag and then the M tells Java the figure means megabytes (which is the most common setting you would use). The memory needs to be available – if it is not the program will fail to run.
So if you need a little more memory, just add this flag to your Java command.
I was asked to explain memory usage in a (hopefully) non-technical way which led to this short article. If there is anything Java/PDF related which you would explained, please drop us a line and we will try to help.
Did you know...
IDRsolutions offers a whole range of online file converters to convert PDF and Microsoft Excel, Word and Office Documents to HTML5, SVG or image formats?
It is free to use for single file conversions and also includes Developer links if you want to use our commercial software for bulk conversions. Find out more on this page