Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Memory profiling in Production environment (http://www.velocityreviews.com/forums/t739580-memory-profiling-in-production-environment.html)

fidentityc 12-06-2010 07:57 AM

Memory profiling in Production environment
 
Hi all,

I've observed from that the GC logs that there is an unmistakable
upward trend that does not come down to it's original levels. This
has led me to suspect that there is a potential memory leak in the
codes.

I've tried to profile the codes in a test environment but to no
avail. This could be because the leak takes place in a section of the
code which is not actively tested in the test environment. As there
are quite a number of applications deployed within the container, and
automated testing is not available, it may prove rather difficult to
go through all test cases in a brute force manner in an attempt to
replicate the issue.

As such, I would like to ask if there is any way to (periodically)
capture memory snapshots of the Production heap that can subsequently
be downloaded for offline analysis. I understand there may be some
performance penalty and I would be grateful if anyone could advise if
the overhead is negligible.

Please feel free to also offer me advise if there are better ways of
achieving my aims.

Thanks in advanced.

Lew 12-06-2010 07:56 PM

Re: Memory profiling in Production environment
 
On Dec 6, 2:57*am, fidentityc <fidenti...@gmail.com> wrote:
> Hi all,
>
> I've observed from that the GC logs that there is an unmistakable
> upward trend that does not come down to it's original levels. *This
> has led me to suspect that there is a potential memory leak in the
> codes.
>
> I've tried to profile the codes in a test environment but to no
> avail. *This could be because the leak takes place in a section of the
> code which is not actively tested in the test environment. *As there
> are quite a number of applications deployed within the container, and
> automated testing is not available, it may prove rather difficult to
> go through all test cases in a brute force manner in an attempt to
> replicate the issue.
>
> As such, I would like to ask if there is any way to (periodically)
> capture memory snapshots of the Production heap that can subsequently
> be downloaded for offline analysis. *I understand there may be some
> performance penalty and I would be grateful if anyone could advise if
> the overhead is negligible.
>
> Please feel free to also offer me advise if there are better ways of
> achieving my aims.
>


<http://download.oracle.com/javase/6/...s/tools/share/
jmap.html>
<http://java.sun.com/developer/technicalArticles/J2SE/monitoring/>

There are a number of tools specific to different application servers,
such as ITCAM for WebSphere Application Server.

GIYF.

--
Lew

fidentityc 12-07-2010 08:20 AM

Re: Memory profiling in Production environment
 
On Dec 7, 3:56*am, Lew <l...@lewscanon.com> wrote:
> On Dec 6, 2:57*am, fidentityc <fidenti...@gmail.com> wrote:
>
>
>
> > Hi all,

>
> > I've observed from that the GC logs that there is an unmistakable
> > upward trend that does not come down to it's original levels. *This
> > has led me to suspect that there is a potential memory leak in the
> > codes.

>
> > I've tried to profile the codes in a test environment but to no
> > avail. *This could be because the leak takes place in a section of the
> > code which is not actively tested in the test environment. *As there
> > are quite a number of applications deployed within the container, and
> > automated testing is not available, it may prove rather difficult to
> > go through all test cases in a brute force manner in an attempt to
> > replicate the issue.

>
> > As such, I would like to ask if there is any way to (periodically)
> > capture memory snapshots of the Production heap that can subsequently
> > be downloaded for offline analysis. *I understand there may be some
> > performance penalty and I would be grateful if anyone could advise if
> > the overhead is negligible.

>
> > Please feel free to also offer me advise if there are better ways of
> > achieving my aims.

>
> <http://download.oracle.com/javase/6/...s/tools/share/
> jmap.html>
> <http://java.sun.com/developer/technicalArticles/J2SE/monitoring/>
>
> There are a number of tools specific to different application servers,
> such as ITCAM for WebSphere Application Server.
>
> GIYF.
>
> --
> Lew


Thanks for the links Lew. I'm however on Java 5. JConsole seems to
come the closest to any kind of monitoring, but what i'm really keen
on is to take snapshots at regular intervals for offline analysis so
that i can determine which objects cannot be garbage collected.

I'm still doing my research but would you know of any tools that
captures snapshots of the heap at regular intervals?

Thanks a lot.

fidentityc 12-07-2010 08:25 AM

Re: Memory profiling in Production environment
 
On Dec 7, 4:20*pm, fidentityc <fidenti...@gmail.com> wrote:
> On Dec 7, 3:56*am, Lew <l...@lewscanon.com> wrote:
>
>
>
> > On Dec 6, 2:57*am, fidentityc <fidenti...@gmail.com> wrote:

>
> > > Hi all,

>
> > > I've observed from that the GC logs that there is an unmistakable
> > > upward trend that does not come down to it's original levels. *This
> > > has led me to suspect that there is a potential memory leak in the
> > > codes.

>
> > > I've tried to profile the codes in a test environment but to no
> > > avail. *This could be because the leak takes place in a section of the
> > > code which is not actively tested in the test environment. *As there
> > > are quite a number of applications deployed within the container, and
> > > automated testing is not available, it may prove rather difficult to
> > > go through all test cases in a brute force manner in an attempt to
> > > replicate the issue.

>
> > > As such, I would like to ask if there is any way to (periodically)
> > > capture memory snapshots of the Production heap that can subsequently
> > > be downloaded for offline analysis. *I understand there may be some
> > > performance penalty and I would be grateful if anyone could advise if
> > > the overhead is negligible.

>
> > > Please feel free to also offer me advise if there are better ways of
> > > achieving my aims.

>
> > <http://download.oracle.com/javase/6/...s/tools/share/
> > jmap.html>
> > <http://java.sun.com/developer/technicalArticles/J2SE/monitoring/>

>
> > There are a number of tools specific to different application servers,
> > such as ITCAM for WebSphere Application Server.

>
> > GIYF.

>
> > --
> > Lew

>
> Thanks for the links Lew. *I'm however on Java 5. *JConsole seems to
> come the closest to any kind of monitoring, but what i'm really keen
> on is to take snapshots at regular intervals for offline analysis so
> that i can determine which objects cannot be garbage collected.
>
> I'm still doing my research but would you know of any tools that
> captures snapshots of the heap at regular intervals?
>
> Thanks a lot.


Actually that's alright. I think I'll just cron jmap to capture the
heap at regular intervals. Thanks a lot for the help.

Lew 12-07-2010 01:21 PM

Re: Memory profiling in Production environment
 
fidentityc wrote:
>>>> As such, I would like to ask if there is any way to (periodically)
>>>> capture memory snapshots of the Production heap that can subsequently
>>>> be downloaded for offline analysis. I understand there may be some
>>>> performance penalty and I would be grateful if anyone could advise if
>>>> the overhead is negligible.


Lew wrote:
>>> GIYF.

>>
>>> --
>>> Lew


Don't quote sigs.

fidentityc wrote:
>> Thanks for the links Lew. I'm however on Java 5. JConsole seems to


You can use jmap and jhat in J5.

>> come the closest to any kind of monitoring, but what i'm [sic] really keen
>> on is to take snapshots at regular intervals for offline analysis so
>> that i [sic] can determine which objects cannot be garbage collected.
>>
>> I'm still doing my research but would you know of any tools that
>> captures snapshots of the heap at regular intervals?

....
> Actually that's alright. I think I'll just cron jmap to capture the
> heap at regular intervals. Thanks a lot for the help.


Use jhat to analyze the dumps that jmap produces. There are also other tools.
<http://download.oracle.com/javase/6/docs/technotes/tools/share/jhat.html>

--
Lew


All times are GMT. The time now is 05:29 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.