Memory usage is very high

Hi,

our production server is running at high memory usgae(around 98%).
i will explain my observations…
last week memory usage went up to 99 % suddenly it went to 30 % (might be garbange collection)
and again day by day the memory usage is going up and now again its 99%.

1)Here my doubt is we are unable to predict when the garbage collection is running only by seeing the memory usage in stats.logs we are expecting this time the garbage collection might have happened…
and why its taking long time for garbage collection to happen.

and we thought of scheduling a java service which will run system.gc()
but ther i heard some preformance issue.
2) can any one brief me wat sort of performance??
and wats the disadvantage of using system.gc() ??

plz help me in this, thx in advance…

We have kind of beat the System.gc() call to death here on this forum. Do a search on System.gc() and you will get lots of discussion.

In a nutshell if you are having to call or thinking you need to call System.gc() you have other issues. The JVM will perform is collections when it needs to. If you are running high memory usage but it is freed up with the major collection occurs then you should not be overly worried. If it does not free up when the major collection runs then you need to go figure out why you are using more memory.

There are lots of reasons memory usage can go so high, and Mark’s right - you need to figure out what is the root cause, not just schedule a garbage collection.

Look at your service usage during those times - are there many services running, or few long-running high memory services, what scheduled jobs are executing during those times, are you calling adapter services that may draw many rows, etc… etc.

Thx u very much for giving reply…
i have gone through the discussion on system.gc() in WMusers,
but here in our case

there wont be requests which are greater than 1MB for sec(some times it may exceed)
and our server is running GC only when the available memory is left up to 1%(i.e. nearly 1MB),i observed it 2 times it happend like that nly.

i have two questions

1)now my question is suppose server is ruuning with 1% free memory and at that time is the requests come for 10MB how do the server handle??? serevr wont crash or hangs at that point of time???

is it some thing like (as mark said ) GC will be collecting memory and it releases the memory at a time(Collectively)… so when those many requests come the GC will release memory???

this is a diff question
2) in server.bat we have allocated 1GB (Both Min and Max)
but in admin page its showing only 750MB as used memory but wat abt the remaining 250 MB is that taken by OS??
if we think that the serever meory will extend then there no point in giving MIN and MAX the same???

Hi Sujith

How are you observing this behavior. I dont agree that GC runs only when nearly 1 MB memory is left up. How did u measure this 1 MB ? IS Admin page is not very accurate and it should be used for trouble shooting out of memory error. The frequency of GC depends on many things like allocated memory, Services used, Yound/Tenure Generation size, GC alogrithms etc.

Print the verbose GC details by editing the server.bat file and this will give you the details of the GC including the time it took , memory freed, Type of GC(Full GC or not), frequency.

No GC does not release memory collectively. It release the memory as soon as its finishes the GC cycle. If you feel memory is not release or its getting allocated again, then I think you should check the code to see if their is any memory leaks. Even if their are no memory leaks; IS may run out of memory if you are running the services with very large Data/Document or if IS is getting more request than it can handle with the allocated memory.

No idea why IS Admin shows 750 MB. May be its not showing memory allocated to Perm Gen.

Jiten

I’m viewing that in stats log the memory usage is going tll100%(only 1MB left as free) at that point gc has invoked and suddenly the free memory came to 600MB

can any one suggest me how to tune the server for the threshold level which we want
from one of the previous post i ahve seen taht we can set a threshold level so that GC will be invoked after that level…

Hi Sujith,

As I told you, try getting the verbos GC logs( -XX:+PrintGCDetails) and you will get the exact information about the frequency of GC, time it took, memory freed etc.

Their is no threshold level as such when the GC gets invoked. GC runs whenever JVM is not able to find enough memory to allocate the objects. This in turn depends on the Size of the allocated memory, size of young generation, size of tenure generation etc. Go through the below links and you will get an idea of how GC works.

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
http://java.sun.com/docs/hotspot/gc1.4.2/faq.html

Jiten

Are you noticing any symptoms other than the IS Admin page or the stats.log reporting high memory usage? If nothing is failing, there would seem to be little cause for concern.

Hi Reamon

nice to hear replies from all you, i was weel educated on this topic especially by seeing forums and sharing info with u all.

as we are in production envi we are jus taking it as a precationary one.day to day our prod envi is growing application wise(requests are getting increased)
and as we dont wann face any issue with memory in future, and seeing 100 % usage of memory will make any one to worry in prod envi…

If the number of integrations hosted in your environment keep growing, you’d be wise to keep an eye on your server sizing. At some point, you may need to change your infrastructure. Use the GEAR materials for sizing estimates to help plan when your current infrastructure needs to change to accomodate increasing workloads.