Why can’t you increase the memory allocated to the JVM?
Here’s some code to modify the ram allocation on a machine that can support it.
java -Xmx2G -Xms2G -jar client.jar
Change those numbers to your liking, but over 4 gigabytes the 32 bit JVM doesn’t support it.
Also if you’re using OpenGL, most assets are streamed into VRAM without a copy on the client side… So unless you have a huge custom cursor icon, Textures and Images shouldn’t be a RAM issue. ( I believe )
If you’re concerned about things taking up too much memory, check out VisualVM. theagentd recommended it to me and it saved my life. It gives you detailed info about a Java programs memory.