Restrict Memory Usage | OutOfMemoryError
The programs memory is managed by Java, which means Java allocates a certain amount of memory which is then filled up with data of the program and once Java decides so, it cleans up data that is not used anymore (Garbage Collection). This leads to the actual memory usage going up and down constantly, while the allocated memory mostly stays the same. So even if only 50 MB are filled with data by the program at the time, Java may still have 200 MB reserved to optimize Gargabe Collection. Thus, the memory usage in e.g. the Task Manager may not reflect what the program actually requires, just how much Java uses.
/appinfo command in Chatty to get some information
about the current memory usage.
A typical memory usage pattern, which can change over time as the program
is running while Java optimizes Gargabe Collection:
You can restrict how much memory Java is allowed to use by specifying
commandline parameters for Java. Create a shortcut
and add the appropriate parameter after the
For example to restrict memory to 150 MB:
javaw -Xmx150M -jar "D:\Chatty\Chatty.jar".
You should test out yourself how low you can go, although more than 100 MB
is usually recommended. Note that Java will show a higher usage than
this in the Task Manager, since this pretty much only restricts how much
the program can store, Java will need some more for it's own management
For the Windows Standalone version you can add this value to the file
<path to Chatty>/app/Chatty.cfg.
If you get an OutOfMemoryError then Java ran out of memory. This can either be because it simply can't allocate enough memory (at least 100 MB is recommended) or there is a bug that prevents it from cleaning up memory that is not actually used anymore. These kinds of bugs are pretty difficult to track down though, especially if they only occur somewhat randomly.