Java memory issue

suffusion

New member
Posting this here because while I'm pretty sure this isn't a problem on mafia's end, it's possible someone else has run into my issue and can lend me a hand. Yesterday, mafia stopped loading with an OutOfMemoryError. I gave it more memory by means of -Xmx1024m and it ran happily. A few hours later, I went to run mafia again and it gave me the same memory error. So I boosted the memory to 2048 and it ran happily. I wasn't happy, though, since it seemed to expand to use however much memory I gave it. This morning, mafia won't run at all, even when I give it all the memory I have.

I'm running Ubuntu 12.04. Have tried using java 6 & 7 openjdk as well as sun java 7. Get this issue with all of them. Anyone else come across this?
 

roippi

Developer
Sounds like your java processes aren't getting killed. Use ps -aux (or whatever) and kill to kill them. You should also probably figure out why they're not closing properly.
 

suffusion

New member
You get this error when you first open mafia?

Yes. It's not like mafia is running and there's some slow memory leak.


Sounds like your java processes aren't getting killed. Use ps -aux (or whatever) and kill to kill them. You should also probably figure out why they're not closing properly.

It isn't this. There are no lingering java processes and even if I failed to find them, a computer reboot doesn't fix the issue.
 
This symptom happened to me some time ago.

I then found that the size of ~/.kolmafia/settings/GLOBAL_prefs.txt was huge, and was increasing each time I ran KoLmafia.

Now my memory gets fuzzy on what exactly the problem was, but there was an entry in there that had something to do with the Daily Deeds. It looked like it had a whole bunch (i.e. many megabytes) of bad UTF-8 sequences in it, From what I inferred, it appeared KoLmafia would process this setting very often, doing something like decoding it as latin1 and re-encoding it as UTF-8, thereby increasing the size.

I "solved" it by removing this line from ~/.kolmafia/settings/GLOBAL_prefs.txt, and made a mental note to check whether I could cleanly reproduce it and then report it as a bug. I clearly failed doing that, but when I read your post, I thought that could be the same problem.

So, I suggest checking whether you are suffering from the same symptom, and then maybe we could find the underlying problem.
 

suffusion

New member
Thanks for the tip, zeroToNine. Deleting the GLOBAL_prefs.txt document solved my problem and allowed mafia to start normally using a normal amount of memory.

As for investigating the precise cause of the issue, I will get back to you as soon as my text editor finishes opening the 201.3MB(!) file that constituted my previous GLOBAL_prefs.txt.
 
Top