MauveCloud / Ic2ExpReactorPlanner

A planner for nuclear reactors in the popular Minecraft mod IndustrialCraft2 Experimental.
GNU General Public License v2.0
179 stars 30 forks source link

[Suggestion] Allow configuration of maximum RAM usage #41

Closed KrisBigK closed 5 years ago

KrisBigK commented 5 years ago

After updating to 2.3, I noticed that the RAM usage of a single planner program has almost doubled while the simulation time is reduced. I often run 2 minecraft programs and 3 planners (when designing reactors) at once, one survival and another creative. With 2 GB taken by each MC my computer is running out of RAM since it has only 8 GB of RAM. Thus I'd be happy to see an adjustable maximum RAM usage limitation like minecraft do.

MauveCloud commented 5 years ago

Java does not allow adjusting this within the application - see https://stackoverflow.com/questions/2073869/how-to-increase-java-heap-size-programmatically

Minecraft has a launcher, so a player can change the memory allocation there (among other things).

I've tried to keep the reactor planner as a standalone application, not requiring a launcher or libraries (or an installer to place them). If you want to adjust the maximum RAM usage, you can write a simple batch file (or .sh file if you're on linux, I guess - not sure what the Mac equivalent is) to pass command-line arguments to the JVM for that. I admit I haven't tested it with tighter ram usage limits, so there's a chance I'll need to do some optimization to get that working safely.

KrisBigK commented 5 years ago

Alright. Since this is a problem with Java, I'm going to close this one.