Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java, Spring, Tomcat, hangs at "INFO: Initializing Spring root WebApplicationContext", I think I changed the allowed memory heap for my entire system

I was playing around with the Java memory heap allocation and I think I did something that set it not just for any specific tomcat folder but for the entire system as I can't run my application in Spring or with a custom tomcat folder that I had been also using for testing. When I try to run the application, it just hangs at "INFO: Initializing Spring root WebApplicationContext".

I am not fully clear on how I could have set this on the Linux command line by doing something like "export CATALINA_OPTS="-Xms2000m -Xmx4500m" or "JAVA_OPTS="-Xms2000m -Xmx4500m -XX:MaxPermSize=4500m"

I think I accidentally put the settings I had meant for my cloud server (which has a higher amount of memory) so I gave it more memory allocation than my entire system has.

I would appreciate any help if anyone can let me know if it is possible I did this and if this could be causing the issue and how I can get an output from my system as to the current allocation so I can check / change it, I have tried "export CATALINA_OPTS="-Xms2000m -Xmx4500m" but it still won't work for me.

I would like to restore everything to default settings. I normally set the memory heap allocation in the /bin/startup.sh file in the tomcat folder but I had forgotten this, I think, and was experimenting with things on the command line.

Thanks

like image 961
Rick Avatar asked Feb 28 '11 20:02

Rick


2 Answers

Check all of the log files for Tomcat. It's possible that the startup of the Spring WebApplicationContext is encountering errors, but logging it elsewhere.

Setting the max heap size too large for Tomcat sounds like a red herring to me. If the initial heap size argument is larger than the maximum size of memory on the system, the Java process will fail immediately - Tomcat will not get to the point of initializing your Spring application.

like image 168
matt b Avatar answered Nov 14 '22 05:11

matt b


See if you can increase the server timeout if you are running it from an IDE. From command line, you'll have to wait. If the problem persists, try cleaning /reloading the application

like image 40
sumit Avatar answered Nov 14 '22 04:11

sumit