You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2010/03/02 00:06:25 UTC

Memory Usage Display in the Web Console

Hi all,

As of Java 5, the platform provides a big number of information about
the memory state for the virtual machine.

I have hacked together a Web Console plugin to display the overall
memory use as well as usage of the different memory pools. The plugin
also allows for creating heap dumps and for downloading these heap dumps.

In addition, the plugin ensures, any existing heap dumps are also
included in the ZIP download of the Configuration Status page.

Finally, the plugin allows for setting a percentage threshold (50-100%)
of memory usage (Perm Gen and Old Gen). As soon as memory consumption
crosses the threshold a heap dump is automatically generated (and yes,
if the threshold is repeatedly crossed, a dump is generated each time
the threshold is crossed, not just the first time).

The plugin requires a trunk build of the Apache Felix Web Console and is
available from my whiteboard at [1].

Enjoy and tell me what you think.

Regards
Felix

[1]http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/memoryusage

Re: Memory Usage Display in the Web Console

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 02.03.2010 10:46, Bertrand Delacretaz wrote:
> On Tue, Mar 2, 2010 at 12:06 AM, Felix Meschberger <fm...@gmail.com> wrote:
>> ...Enjoy and tell me what you think....
> 
> Looks useful, and I agree with Carsten that that could be a Felix
> module instead.
> 
> The name is "Heap Dumps" in the console's list of plugins, maybe
> "Memory Usage" would be more accurate.

Good point. Thanks.

Regards
Felix

Re: Memory Usage Display in the Web Console

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Mar 2, 2010 at 12:06 AM, Felix Meschberger <fm...@gmail.com> wrote:
> ...Enjoy and tell me what you think....

Looks useful, and I agree with Carsten that that could be a Felix
module instead.

The name is "Heap Dumps" in the console's list of plugins, maybe
"Memory Usage" would be more accurate.

-Bertrand

Re: Memory Usage Display in the Web Console

Posted by Felix Meschberger <fm...@gmail.com>.

On 03.03.2010 14:35, Felix Meschberger wrote:
> Hi,
> 
> On 03.03.2010 14:20, Philipp Koch wrote:
>> why not persisting the dump in the repository with timestamps,
>> information about memory stats and other useful info when the dump got
>> triggered.
>> if we do so, the dump would be accessible within sling pretty easily over http.
> 
> That would (theoretically) something to consider, but:
> 
>  * The VM writes to the filesystem anyway (not a stream, a file)
>  * In an OOME situation it might not be possible to write to the repo
> 
> Plus, the dumps are available via http of course, because the plugin
> provides them.

Plus, the dumps could be made available through Sling using the FS
Resource Provider.

So no real need to push the dumps into the repository.

In addtion, if the system is running in a cluster, storing the dumps in
the repository, might create a number of follow-up issues to solve.

Regards
Felix

> 
> Regards
> Felix
> 
>>
>> regards,
>> philipp
>>
>> On Wed, Mar 3, 2010 at 2:14 PM, Felix Meschberger <fm...@gmail.com> wrote:
>>> Hi,
>>>
>>> On 03.03.2010 13:59, Marcel Reutegger wrote:
>>>> hi,
>>>>
>>>> On Tue, Mar 2, 2010 at 00:06, Felix Meschberger <fm...@gmail.com> wrote:
>>>>> Hi all,
>>>>>
>>>>> As of Java 5, the platform provides a big number of information about
>>>>> the memory state for the virtual machine.
>>>>>
>>>>> I have hacked together a Web Console plugin to display the overall
>>>>> memory use as well as usage of the different memory pools. The plugin
>>>>> also allows for creating heap dumps and for downloading these heap dumps.
>>>>
>>>> nice.
>>>>
>>>>> In addition, the plugin ensures, any existing heap dumps are also
>>>>> included in the ZIP download of the Configuration Status page.
>>>>>
>>>>> Finally, the plugin allows for setting a percentage threshold (50-100%)
>>>>> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
>>>>> crosses the threshold a heap dump is automatically generated (and yes,
>>>>> if the threshold is repeatedly crossed, a dump is generated each time
>>>>> the threshold is crossed, not just the first time).
>>>>
>>>> is that configurable? if things go wrong, an application will probably
>>>> throw OOME multiple times. that would quickly fill the disk.
>>>
>>> Not yet.
>>>
>>> But I am thinking of adding a switch to prevent dumps from being written
>>> in too close succession. For example setting this to "1d" would write a
>>> dump only once a day.
>>>
>>> This could also be used to specify "only dump once and then ignore any
>>> further events".
>>>
>>> Regards
>>> Felix
>>>
>>>>
>>>> regards
>>>>  marcel
>>>>
>>>>> The plugin requires a trunk build of the Apache Felix Web Console and is
>>>>> available from my whiteboard at [1].
>>>>>
>>>>> Enjoy and tell me what you think.
>>>>>
>>>>> Regards
>>>>> Felix
>>>>>
>>>>> [1]http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/memoryusage
>>>>>
>>>>
>>>
>>

Re: Memory Usage Display in the Web Console

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 03.03.2010 14:20, Philipp Koch wrote:
> why not persisting the dump in the repository with timestamps,
> information about memory stats and other useful info when the dump got
> triggered.
> if we do so, the dump would be accessible within sling pretty easily over http.

That would (theoretically) something to consider, but:

 * The VM writes to the filesystem anyway (not a stream, a file)
 * In an OOME situation it might not be possible to write to the repo

Plus, the dumps are available via http of course, because the plugin
provides them.

Regards
Felix

> 
> regards,
> philipp
> 
> On Wed, Mar 3, 2010 at 2:14 PM, Felix Meschberger <fm...@gmail.com> wrote:
>> Hi,
>>
>> On 03.03.2010 13:59, Marcel Reutegger wrote:
>>> hi,
>>>
>>> On Tue, Mar 2, 2010 at 00:06, Felix Meschberger <fm...@gmail.com> wrote:
>>>> Hi all,
>>>>
>>>> As of Java 5, the platform provides a big number of information about
>>>> the memory state for the virtual machine.
>>>>
>>>> I have hacked together a Web Console plugin to display the overall
>>>> memory use as well as usage of the different memory pools. The plugin
>>>> also allows for creating heap dumps and for downloading these heap dumps.
>>>
>>> nice.
>>>
>>>> In addition, the plugin ensures, any existing heap dumps are also
>>>> included in the ZIP download of the Configuration Status page.
>>>>
>>>> Finally, the plugin allows for setting a percentage threshold (50-100%)
>>>> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
>>>> crosses the threshold a heap dump is automatically generated (and yes,
>>>> if the threshold is repeatedly crossed, a dump is generated each time
>>>> the threshold is crossed, not just the first time).
>>>
>>> is that configurable? if things go wrong, an application will probably
>>> throw OOME multiple times. that would quickly fill the disk.
>>
>> Not yet.
>>
>> But I am thinking of adding a switch to prevent dumps from being written
>> in too close succession. For example setting this to "1d" would write a
>> dump only once a day.
>>
>> This could also be used to specify "only dump once and then ignore any
>> further events".
>>
>> Regards
>> Felix
>>
>>>
>>> regards
>>>  marcel
>>>
>>>> The plugin requires a trunk build of the Apache Felix Web Console and is
>>>> available from my whiteboard at [1].
>>>>
>>>> Enjoy and tell me what you think.
>>>>
>>>> Regards
>>>> Felix
>>>>
>>>> [1]http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/memoryusage
>>>>
>>>
>>
> 

Re: Memory Usage Display in the Web Console

Posted by Philipp Koch <pk...@day.com>.
why not persisting the dump in the repository with timestamps,
information about memory stats and other useful info when the dump got
triggered.
if we do so, the dump would be accessible within sling pretty easily over http.

regards,
philipp

On Wed, Mar 3, 2010 at 2:14 PM, Felix Meschberger <fm...@gmail.com> wrote:
> Hi,
>
> On 03.03.2010 13:59, Marcel Reutegger wrote:
>> hi,
>>
>> On Tue, Mar 2, 2010 at 00:06, Felix Meschberger <fm...@gmail.com> wrote:
>>> Hi all,
>>>
>>> As of Java 5, the platform provides a big number of information about
>>> the memory state for the virtual machine.
>>>
>>> I have hacked together a Web Console plugin to display the overall
>>> memory use as well as usage of the different memory pools. The plugin
>>> also allows for creating heap dumps and for downloading these heap dumps.
>>
>> nice.
>>
>>> In addition, the plugin ensures, any existing heap dumps are also
>>> included in the ZIP download of the Configuration Status page.
>>>
>>> Finally, the plugin allows for setting a percentage threshold (50-100%)
>>> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
>>> crosses the threshold a heap dump is automatically generated (and yes,
>>> if the threshold is repeatedly crossed, a dump is generated each time
>>> the threshold is crossed, not just the first time).
>>
>> is that configurable? if things go wrong, an application will probably
>> throw OOME multiple times. that would quickly fill the disk.
>
> Not yet.
>
> But I am thinking of adding a switch to prevent dumps from being written
> in too close succession. For example setting this to "1d" would write a
> dump only once a day.
>
> This could also be used to specify "only dump once and then ignore any
> further events".
>
> Regards
> Felix
>
>>
>> regards
>>  marcel
>>
>>> The plugin requires a trunk build of the Apache Felix Web Console and is
>>> available from my whiteboard at [1].
>>>
>>> Enjoy and tell me what you think.
>>>
>>> Regards
>>> Felix
>>>
>>> [1]http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/memoryusage
>>>
>>
>

Re: Memory Usage Display in the Web Console

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 03.03.2010 13:59, Marcel Reutegger wrote:
> hi,
> 
> On Tue, Mar 2, 2010 at 00:06, Felix Meschberger <fm...@gmail.com> wrote:
>> Hi all,
>>
>> As of Java 5, the platform provides a big number of information about
>> the memory state for the virtual machine.
>>
>> I have hacked together a Web Console plugin to display the overall
>> memory use as well as usage of the different memory pools. The plugin
>> also allows for creating heap dumps and for downloading these heap dumps.
> 
> nice.
> 
>> In addition, the plugin ensures, any existing heap dumps are also
>> included in the ZIP download of the Configuration Status page.
>>
>> Finally, the plugin allows for setting a percentage threshold (50-100%)
>> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
>> crosses the threshold a heap dump is automatically generated (and yes,
>> if the threshold is repeatedly crossed, a dump is generated each time
>> the threshold is crossed, not just the first time).
> 
> is that configurable? if things go wrong, an application will probably
> throw OOME multiple times. that would quickly fill the disk.

Not yet.

But I am thinking of adding a switch to prevent dumps from being written
in too close succession. For example setting this to "1d" would write a
dump only once a day.

This could also be used to specify "only dump once and then ignore any
further events".

Regards
Felix

> 
> regards
>  marcel
> 
>> The plugin requires a trunk build of the Apache Felix Web Console and is
>> available from my whiteboard at [1].
>>
>> Enjoy and tell me what you think.
>>
>> Regards
>> Felix
>>
>> [1]http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/memoryusage
>>
> 

Re: Memory Usage Display in the Web Console

Posted by Marcel Reutegger <mr...@day.com>.
hi,

On Tue, Mar 2, 2010 at 00:06, Felix Meschberger <fm...@gmail.com> wrote:
> Hi all,
>
> As of Java 5, the platform provides a big number of information about
> the memory state for the virtual machine.
>
> I have hacked together a Web Console plugin to display the overall
> memory use as well as usage of the different memory pools. The plugin
> also allows for creating heap dumps and for downloading these heap dumps.

nice.

> In addition, the plugin ensures, any existing heap dumps are also
> included in the ZIP download of the Configuration Status page.
>
> Finally, the plugin allows for setting a percentage threshold (50-100%)
> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
> crosses the threshold a heap dump is automatically generated (and yes,
> if the threshold is repeatedly crossed, a dump is generated each time
> the threshold is crossed, not just the first time).

is that configurable? if things go wrong, an application will probably
throw OOME multiple times. that would quickly fill the disk.

regards
 marcel

> The plugin requires a trunk build of the Apache Felix Web Console and is
> available from my whiteboard at [1].
>
> Enjoy and tell me what you think.
>
> Regards
> Felix
>
> [1]http://svn.apache.org/repos/asf/sling/whiteboard/fmeschbe/memoryusage
>

Re: Memory Usage Display in the Web Console

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 02.03.2010 10:35, Carsten Ziegeler wrote:
> Felix Meschberger wrote:
>> Hi all,
>>
>> As of Java 5, the platform provides a big number of information about
>> the memory state for the virtual machine.
>>
>> I have hacked together a Web Console plugin to display the overall
>> memory use as well as usage of the different memory pools. The plugin
>> also allows for creating heap dumps and for downloading these heap dumps.
>>
>> In addition, the plugin ensures, any existing heap dumps are also
>> included in the ZIP download of the Configuration Status page.
>>
>> Finally, the plugin allows for setting a percentage threshold (50-100%)
>> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
>> crosses the threshold a heap dump is automatically generated (and yes,
>> if the threshold is repeatedly crossed, a dump is generated each time
>> the threshold is crossed, not just the first time).
>>
>> The plugin requires a trunk build of the Apache Felix Web Console and is
>> available from my whiteboard at [1].
>>
>> Enjoy and tell me what you think.
>>
> Sounds great, +1
> 
> The only remark I have, shouldn't this be a project in Apache Felix? :)
> We already have a web console plugin section there.

Probably makes sense, yes.

Regards
Felix

Re: Memory Usage Display in the Web Console

Posted by Karl Pauls <ka...@gmail.com>.
Great stuff! Would be cool for felix but good to have no matter where :-)

regards,

Karl

On Tue, Mar 2, 2010 at 10:35 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> Felix Meschberger wrote:
>> Hi all,
>>
>> As of Java 5, the platform provides a big number of information about
>> the memory state for the virtual machine.
>>
>> I have hacked together a Web Console plugin to display the overall
>> memory use as well as usage of the different memory pools. The plugin
>> also allows for creating heap dumps and for downloading these heap dumps.
>>
>> In addition, the plugin ensures, any existing heap dumps are also
>> included in the ZIP download of the Configuration Status page.
>>
>> Finally, the plugin allows for setting a percentage threshold (50-100%)
>> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
>> crosses the threshold a heap dump is automatically generated (and yes,
>> if the threshold is repeatedly crossed, a dump is generated each time
>> the threshold is crossed, not just the first time).
>>
>> The plugin requires a trunk build of the Apache Felix Web Console and is
>> available from my whiteboard at [1].
>>
>> Enjoy and tell me what you think.
>>
> Sounds great, +1
>
> The only remark I have, shouldn't this be a project in Apache Felix? :)
> We already have a web console plugin section there.
>
> Carsten
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>



-- 
Karl Pauls
karlpauls@gmail.com

Re: Memory Usage Display in the Web Console

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi all,
> 
> As of Java 5, the platform provides a big number of information about
> the memory state for the virtual machine.
> 
> I have hacked together a Web Console plugin to display the overall
> memory use as well as usage of the different memory pools. The plugin
> also allows for creating heap dumps and for downloading these heap dumps.
> 
> In addition, the plugin ensures, any existing heap dumps are also
> included in the ZIP download of the Configuration Status page.
> 
> Finally, the plugin allows for setting a percentage threshold (50-100%)
> of memory usage (Perm Gen and Old Gen). As soon as memory consumption
> crosses the threshold a heap dump is automatically generated (and yes,
> if the threshold is repeatedly crossed, a dump is generated each time
> the threshold is crossed, not just the first time).
> 
> The plugin requires a trunk build of the Apache Felix Web Console and is
> available from my whiteboard at [1].
> 
> Enjoy and tell me what you think.
> 
Sounds great, +1

The only remark I have, shouldn't this be a project in Apache Felix? :)
We already have a web console plugin section there.

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org