• Post Reply Bookmark Topic Watch Topic
  • New Topic

JVM & Garbage Collection on Unix vs. Linux  RSS feed

 
Elle Atechsy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can anyone point me in a direction to find out if Sun's JRE 1.4.2 handles differently on Unix vs. Linux?

I have a Java application that I need to infinitely run so it can listen for incoming MQ messages. On Unix, it has been running for days, but on Linux it stops within 2 hours. I have a while loop to keep the message receiver running. But, I read somewhere that the Garbage Collector could be cleaning up non-static objects prematurely. Could this be an issue on Linux, but not on Unix?

Any help is appreciated.

Thanks,
Lulu
 
Joe Ess
Bartender
Posts: 9443
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you certain that your applications are started with the same command line options? There's Hotspot VM's, one for client environments and one for servers. You can specify the amount of memory available to the vm using command line switches. There's also non-standard options which can further tune VM performance.
Have you checked the obvious problems, like the amount of traffic the machines are processing, the amount of physical memory and so on?
 
Elle Atechsy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the obvious problems, like the amount of traffic the machines are processing, the amount of physical memory and so on?


I had not checked those items. These servers are enterprise servers, not under my control, and I assumed they would have plenty of physical memory, and did not think about the traffic. However, thank you for mentioning that to me, because now that I think about it, this server is used as a web server farm on which several development groups within our company house their web apps. So, it makes a lot of since to check into that.

For anyone else who may be encountering a similar issue, during my test of a previous lead I found regarding the GC cleaning up non-static objects, I made my MQconnectionFactory object static, and the application that was dying within 2 hrs has been running for over 16 hrs so far. It seems that NOT making the object static was causing the GC to clean it up before I wanted it to. And making it static has put it in the "reachable" zone of the heap, and therefore the GC won't throw it away. Please click here for the article.

Thank you, Joe. The documentation is a good start. Although, I think I found a solution to my issue, I still do not understand the inner workings of the JVM, and the possible different behaviors of it on different platforms. I will definitely read up on this.


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!