• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Shut down JVM using command

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is it possible to shut down JVM using command ? Actually I am using glassfish v3 and after a few re-deployments of my development project, the JVM complains of "java.lang.OutOfMemoryError: PermGen space". I have posted the the question in glassfish 3 forum Glassfish Out of Memmory problem. Till I resolve the out of memory error, I need to manually shut down the JVM to release memory. So I am looking for the shutdown command for the JVM.

regards,
Nirvan
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked the documentation for the memory requirements?

I need to manually shut down the JVM to release memory


You can shutdown (results in JVM shutdown) the glassfish.
 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Have you checked the documentation for the memory requirements?


I have given 1024MB for PermGen space. That should be more than enough. I had come across a few sites that said that there were some memory leaks for glassfish 2 related to class loaders. I am not sure whether that problem passed through to v3. I will have to take a look at the problem in more detail, but right now I am only concentrating on development.

You can shutdown (results in JVM shutdown) the glassfish.


This is what I was expecting. But to my surprise, the server status in my netbeans IDE already shows shut down. Eventually when I try to start the glassfish again, the "out of memory" corps out again. Its only after I shut down my PC and restart it again, that the "out of memory" fades off. I was looking for a quick fix so that I can continue development without having to restart my pc every now and then.

regards,
Nirvan
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Its only after I shut down my PC and restart it again, that the "out of memory" fades off. I was looking for a quick fix so that I can continue development without having to restart my pc every now and then.



From my experience with Tomcat it's often too late for a regular shutdown, when the server JVM hangs because of an out-of-memory problem. But it shouldn't be necessary to restart your computer in order to force the JVM to shutdown. It should be enough to kill the corresponding Java process. Depending on your OS you'll have to use the Windows task manager, a Linux console or something like this to find and kill the Java process which belongs to the Glassfish server. But you should take care not to kill other Java process for example the one for your NetBeans IDE ;-) On Linux it's easy to find the right Java process because you can usually see the whole command line for the process in question and figure out if it's the JVM process used to startup Glassfish.

Hope this helps with your development although I don't know how to solve the root cause of the problem!

Marco
 
B Nirvan
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Macro,
Killing the glassfish process worked for me. That was indeed a very quick fix. Thanks a lot.

regards,
Nirvan.
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic