[coldbox-4.0.0-rc+00002-201410230827] out of memory error

Hello!

Today I decided to take an app I was working on in 3.8 and update to 4.0. I got things going ok but twice now I’ve run out of memory, both times in the last few hours. The first time I didn’t see what was loading when it crashed but thinking might be Railo related I updated Railo plus I bumped a couple of memory settings (current below). A few minutes ago it did it again. Likely something I have wrong but figured I’d post the two screen dumps here. The first one is the error on the page I was requesting and the second one is on reinit. Does anyone know offhand if this looks familiar and might be something I’m doing wrong?

Thank you!

irv

PS… It’s just a semi-dev box with nothing really running on it except one small site plus this app I’m working on.

#################### memory settings ####################

JAVA_OPTS="-Xms256m -Xmx1024m -XX:MaxPermSize=256m -javaagent:lib/railo-inst.jar"; # memory settings

#################### 1st screen - page requested ####################

Oopsy! Something went wrong!Event: N/A

Routed URL: N/A
Layout: N/A (Module: )
View: N/A
Timestamp: 12/07/2014 11:48:29 PM

Are you using java loader?

Yes, I believe it was downloaded by commandbox when I downloaded antiSamy. I also had modules autoReload = true in config as I was just trying to get things set up. I just set that to false a little bit ago to see if that was the issue.

That appendPaths() code runs every time the module loads, which also happens on reinit.

It’s probably loading the same URLs into the classloader every time which builds up over time since the javaloader is server-scoped to prevent permgen leaks. I’d need to use a memory profiler to prove it but it seems likely given the criteria.

Maybe we need to enhance it to use getLoadedURLs() to not load URLs that are already in the classloader. We should probably recreate the issue first though, otherwise we won’t know if it’s actually. Now that I’m using CommandBox for development, I just start and stop ad-hoc Railo servers because it’s so freaking darn easy. The trouble is, I rarely run them for more than a few hours so I wouldn’t have noticed a heap filling up since that takes more time.

Note: the “URLs” in this context are not HTTP addresses, but local file system “URLs” that point to a jar file.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com