Skip to main content

Analze the Performance of the java application

2 replies [Last post]
Joined: 2007-10-04


I have calculated the performance of the java application in the NetBeans Profiler.I analyzed the memory usage of the application. suddenly i forced the garbage collector when program is executing. After garbage collection some char[] and byte[] are using some memory. it is a memory leak or any thing else.please any body help me.

Y it is taking the memory after garbage collection.

Thank u very much

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-10-22

Hi madhu_mvgr !
GC will only clean up if the objects are no longer referenced by ANY part of your application. I doubt you will see NO objects still in Heap after a Full GC. I think you may be worried un necessarily.

Now, if the Heap Utilization grows over the time even with occational GCs, you might have memory leak. You will need to observe it for a while though.

Are you continueously printing data to standard out from your code? It is generally a bad idea because it takes up String objects.

Good Luck !
- Karun

Joined: 2007-05-01

Your char arrays are probably Strings. byte arrays could be a number of things, especially if you are working with files. Dig a little deeper and find out what owns those arrays.

If you are using the Analyze Memory feature, turn on 'Record stack trace for allocations' and then right click on byte[] and char[] in the results. That will show you where those arrays are.

There are all sorts of reasons why they might be retained after a gc, really depends on the containing classes, etc..