Operating System - HP-UX
1829107 Members
2773 Online
109986 Solutions
New Discussion

garbage collection for j2ee application on Oracle iAS 9041

 
Charles Li_1
Advisor

garbage collection for j2ee application on Oracle iAS 9041

We installed Oracle iAS 9041 to run a j2ee application from the Internet. We configured the OC4J container to use default heap size.

We use dmstools to gather memory usage on Forms and plotted out the free memory value.
During the course of 1 day, we see it did garbage collections every 10 minutes. Please see attachment.
Question: Is this a normal frequency for garbage collection?
Thanks.
1 REPLY 1
TwoProc
Honored Contributor

Re: garbage collection for j2ee application on Oracle iAS 9041

Garbage collection in Java, sadly enough - is not guaranteed to happen. Memory deallocation from deconstruction may happen, may not. Memory will be marked for deletion, but garbage runs determine when actual deallocation occurs.

The fact that it is happening every 10 minutes tells me that apparently the rate of usage of the program is pretty constant, but not much more.

I'm guessing that what you're seeing is that performance noticeably goes down during the garbage collect phase - right?

We somewhat solved this by *suggesting* that garbage collection happen more often. You can do this as you your exits certain areas of the program by making a call to the public static method of class System(java.lang):


System.gc();

.

This will SUGGEST to the java engine that it is time to garbage collect, and it is generally willing in my experience.

Doing this *can* make the garbage collection happen in little chunks (as user exits areas of functionality), instead of waiting a while for them to bundle, and having to clear out loads of data.

Try this approach, it might work for you.

You could go another way, by increasing the available memory, you will garbage collect less often - but the penalty will be that when it does have to happen, it will take longer. So, I don't recommend that approach.

We are the people our parents warned us about --Jimmy Buffett