Difficulty locating the objects in application mentioned in Java Profiler

186 views Asked by At

I am using YourKit Java profiler for my web application which is hosted on Weblogic. I am investigating a memory leak currently. The profiler shows some quarter million char[] objects that are occupying 25% memory.

I tried looking into my application as to where these char[] objects are created. Surprisingly, I didn't find any. Am I doing something wrong here? Is Weblogic internally creating these Array objects?

How do I locate in my application the exact piece of code that is creating these objects? Thanks.

Regards, Siddharth

2

There are 2 answers

2
Roland Illig On BEST ANSWER

Most probably these character arrays form the internal part of a java.lang.String. You should ask your profiler to give you an overview of the strings that are currently in memory and whether there are many duplicates.

0
Andrew White On

Roland is right on about the char[]s probably being in Strings. I would recommend using FindBugs for a static analysis of your code. This usually finds a lot of good stuff. Something else you should do is look in your session objects since those are more persistent.

I don't know about YourKit so I can't comment on actually tracing down allocation sources, sorry.