I'm a horrible noob and Keep running out of memory.

hobo386

New member
Whenever I'm playing for a long time, say ending an ascension, and running through the first day of the next, mafia becomes horribly sluggish. I'm pretty sure it's because I've ran out of free memory, because the bar at the top of mafia says something along the lines of 64900k/65088k (usually it starts out at around 30k), and hitting the "collect garbage" button does nothing. Ever since I upgraded to 16.0, it's been getting sluggish more quickly, and I was wondering if there was a way I could fix it.

I use windows XP SP3. Is there a way for me to increase the default heap size for mafia?
 

roippi

Developer
You are correct, that's really too small of a heap size for mafia to run under. It should really have minimum 100MB. On my system, the JVM gives me over a GB by default, which is obviously more than necessary, but doesn't hurt anything.

Java is a little awkward in that developers have little control over how much heap space the user's machine decides to grant the application. Normally your JVM is supposed to pick a reasonable value but it doesn't look like that's happening.

To override what the JVM thinks it wants to give you, you need to set the _JAVA_OPTIONS user environment variable to -Xmx200m (or replace 200m with however many megabytes you want to give it - I wouldn't recommend less than 100m). Here are instructions for setting an environment variable in XP. Optionally, you can provide the -Xmx argument directly to the launcher for the app, if you know how to do that.
 
Top