Bug - Not A Bug r14722 - 100% CPU usage, memory use doubles up.

Ensiferum

Member
Second report today, feel like a spammer - but as the title says.

After switching to r14722 KoLmafia works as usual for 4-5 minutes, then hikes up to 100% CPU and never frees it up. Coincidentally, the amount of memory in use doubles up at the same time.


EDIT: Actually, idle chatting in 14718 ended up with the exact same problem after 15 minutes or so. Might have to test a few older builds, because this really seems a new behaviour.
 
Last edited:

roippi

Developer
Just instrumented r14722 with chat GUI open for 30 minutes, everything looks normal. Going to need more info.
 

Ensiferum

Member
Not sure what kind of info is required, but here's a shot in the dark - would the new threads handling be extremely rough on a really old CPU?
I am probably one of few people in the world still on a single-core Celeron D at 3.33 GHz. Other possibly related info is Win XP as an OS and Java version 1.6.0_26. RAM is a mere 1 GB, but the memory usage actually isn't a problem.

Since the new builds were pretty much a frustrating experience, I went back to 14700 and played an ascension for hour and half. The moment I finished manually playing 280 turns in the relay browser KoLmafia went back to idling at 0% CPU.

Sadly this makes me throw the blame on the threads handling change once again. Sorry for that. :p
 

roippi

Developer
The new thread pooling should be friendlier on old systems. The old paradigm was to rapidly create/tear down threads, now we reuse them.

Also, sitting in chat does not involve firing off a single thread through the thread pool, so I remain dubious that it's responsible.
 

Ensiferum

Member
I'm going to check a few more builds, so far 14718 and 14722 both went to 100% CPU after a few minutes of not doing anything unusual.

Testing 14711 now with a debug log running, just in case it catches anything. Might not be able to experiment more until tomorrow evening, but I'll try to narrow down what build introduced the issue first.
 

roippi

Developer
I added the preference "fixedThreadPoolSize" in r14729. You could try setting that to something low but nonzero (like, 1) and see how that works for you.

(requires restart after setting)
 
Last edited:

Ensiferum

Member
Thanks, greatly appreciated.

I haven't been able to reproduce the full CPU hogging yet even with the builds that previously had it, so it could have been a temporary issue with some quirk in Windows or Java that cleared up on a reboot.

That's also why I usually avoid reporting bugs - most of the time it's something I overlooked in the rush. It is probably safe to mark the thread "not a bug".
 
Top