You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aditi Sinha <ad...@gmail.com> on 2012/09/12 12:02:30 UTC

How to get heap dump of Tomcat running as windows service.

Hi,



We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
service.

When we try to get the heap  dump of Tomcat using the following command



*jmap -dump:format=b,file=heap.bin <pid>*



we get below error



*<pid>: Not enough storage is available to process this command.*



When Tomcat is started manually in console (using command “catalina.bat
start”), we are able to take the heap dump.


Is there any workaround which would allow to take heap dump when Tomcat
running as windows service?


Thanks & Regards,

Aditi

Re: How to get heap dump of Tomcat running as windows service.

Posted by Joao Silva <jo...@vilt-group.com>.
On 12/09/2012 11:02, Aditi Sinha wrote:
> Hi,
>
>
>
> We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
> service.
>
> When we try to get the heap  dump of Tomcat using the following command
>
>
>
> *jmap -dump:format=b,file=heap.bin <pid>*
>
>
>
> we get below error
>
>
>
> *<pid>: Not enough storage is available to process this command.*
>
>
>
> When Tomcat is started manually in console (using command “catalina.bat
> start”), we are able to take the heap dump.
>
>
> Is there any workaround which would allow to take heap dump when Tomcat
> running as windows service?
>
>
> Thanks & Regards,
>
> Aditi
>
Hi

If you are connected to the Windows machine through remote desktop, 
please try to connect to it using the console session (administrative 
credentials required).
This is because starting with Windows 2003, services run with service 
isolation, but you can get around that by connecting to the console session.
Depending on your operating system version (not the server's version), 
you can connect to the console session by

    After Windows XP SP3, Vista SP1

         From the Start menu, choose Run. Type "mstsc /console". Connect
        to the server as usual.

    Other versions

         From the Start menu, choose Run. Type "mstsc /admin". Connect
        to the server as usual.

Hope it helps.

Best regards
-- 
*João M. Silva — VILT Group*
*http://www.vilt-group.com *

Rua Ivone Silva, 6 - 7º Esq
1050-124 Lisboa - Portugal

Mobile 	+351 926 531 097
Phone 	+351 210 34 33 00
Fax 	+351 210 34 33 99
Email 	joao.silva@vilt-group.com <ma...@vilt-group.com>


Re: How to get heap dump of Tomcat running as windows service.

Posted by Aditi Sinha <ad...@gmail.com>.
Hi,

Please find the requested details below

1. What is your OS?
*Windows 7,  32-bit OS. I have even tried on Windows 2k8 server but the
same problem.*

2. How much memory the running Tomcat is using? Do you have enough
space on your hard drive, and does it have access rights to write
there?
*Running Tomcat is using around 247MB and JvmMx is set to 512 MB. There is
enough free disk space available.*
**
*Tomcat is running as the logged on user account and therefore should have
access rights.*
*Also, did not login to machine as remote desktop session. I logged in to
the machine directly.

*Any help appreciated.

Thanks & Regards,
Aditi


On Wed, Sep 12, 2012 at 3:56 PM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2012/9/12 Aditi Sinha <ad...@gmail.com>:
> > Hi,
> >
> >
> >
> > We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
> > service.
> >
> > When we try to get the heap  dump of Tomcat using the following command
> >
> >
> >
> > *jmap -dump:format=b,file=heap.bin <pid>*
> >
> >
> >
> > we get below error
> >
> >
> >
> > *<pid>: Not enough storage is available to process this command.*
> >
> >
> >
> > When Tomcat is started manually in console (using command “catalina.bat
> > start”), we are able to take the heap dump.
> >
> >
> > Is there any workaround which would allow to take heap dump when Tomcat
> > running as windows service?
>
> 1. What is your OS?
> 2. How much memory the running Tomcat is using? Do you have enough
> space on your hard drive, and does it have access rights to write
> there?
>
> Maybe you could try configuring the service to run as specific user
> (instead of Local Service account).
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: How to get heap dump of Tomcat running as windows service.

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/9/12 Aditi Sinha <ad...@gmail.com>:
> Hi,
>
>
>
> We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
> service.
>
> When we try to get the heap  dump of Tomcat using the following command
>
>
>
> *jmap -dump:format=b,file=heap.bin <pid>*
>
>
>
> we get below error
>
>
>
> *<pid>: Not enough storage is available to process this command.*
>
>
>
> When Tomcat is started manually in console (using command “catalina.bat
> start”), we are able to take the heap dump.
>
>
> Is there any workaround which would allow to take heap dump when Tomcat
> running as windows service?

1. What is your OS?
2. How much memory the running Tomcat is using? Do you have enough
space on your hard drive, and does it have access rights to write
there?

Maybe you could try configuring the service to run as specific user
(instead of Local Service account).

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to get heap dump of Tomcat running as windows service.

Posted by Brett Delle Grazie <br...@gmail.com>.
On 14 September 2012 06:14, Aditi Sinha <ad...@gmail.com> wrote:
> Hi,
>

Please do not top-post - it makes the thread very confusing to read.

> Tried below option.
>  jmap -J-Xmx512M -dump:format=b,file=heap.bin <pid>

Tomcat heap = 512M according to your earlier post, is that correct?
jmap heap = 512M (according to the command above).
I suspect jmap heap needs to be greater than Tomcat heap maximum
which is why my original suggestion was to use '-J-Xmx1024M'

Please try it with 1024M as originally suggested.

What JVM version are you using to run Tomcat?

What JVM version are you using to run jmap?

These should be the same.

>
> This too gives the same problem "<pid>: Not enough storage is available to
> process this command"
>
> Thanks & Regards,
> Aditi
>
>
> On Thu, Sep 13, 2012 at 1:40 PM, Brett Delle Grazie
> <br...@gmail.com> wrote:
>>
>> On 12 September 2012 13:14, Pid <pi...@pidster.com> wrote:
>> > On 12/09/2012 11:02, Aditi Sinha wrote:
>> >> Hi,
>> >>
>> >>
>> >>
>> >> We have web server hosted on Tomcat 7.0.22. Tomcat is running as
>> >> windows
>> >> service.
>> >>
>> >> When we try to get the heap  dump of Tomcat using the following command
>> >>
>> >>
>> >>
>> >> *jmap -dump:format=b,file=heap.bin <pid>*
>> >>
>> >>
>> >>
>> >> we get below error
>> >>
>> >>
>> >>
>> >> *<pid>: Not enough storage is available to process this command.*
>> >
>> > probably because you have set a large heap size.
>>
>> try:
>>   jmap -J-Xmx512M -dump:format=b,file=heap.bin <pid>
>>
>> (You _might_ get away with 768M but better to be safe than sorry).
>>
>> I believe jmap is telling you that it doesn't have enough heap
>> available to process tomcat's heap - which you have
>> set at 512M. The default heap is typically quite low.
>>
>> >
>> >> When Tomcat is started manually in console (using command “catalina.bat
>> >> start”), we are able to take the heap dump.
>> >
>> > because you are probably not setting a heap size.
>> >
>> >> Is there any workaround which would allow to take heap dump when Tomcat
>> >> running as windows service?
>> >
>> > make some more disk space available, sufficient to permit the heap to be
>> > written to file.
>> >
>> >
>> > p
>> >
>> >> Thanks & Regards,
>> >>
>> >> Aditi
>> >>
>> >
>> >
>> > --
>> >
>> > [key:62590808]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to get heap dump of Tomcat running as windows service.

Posted by Aditi Sinha <ad...@gmail.com>.
Hi,

Tried below option.
* jmap -J-Xmx512M -dump:format=b,file=heap.bin <pid>*

This too gives the same problem *"<pid>: Not enough storage is available to
process this command"*
**
**Thanks & Regards,
Aditi


On Thu, Sep 13, 2012 at 1:40 PM, Brett Delle Grazie <
brett.dellegrazie@gmail.com> wrote:

> On 12 September 2012 13:14, Pid <pi...@pidster.com> wrote:
> > On 12/09/2012 11:02, Aditi Sinha wrote:
> >> Hi,
> >>
> >>
> >>
> >> We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
> >> service.
> >>
> >> When we try to get the heap  dump of Tomcat using the following command
> >>
> >>
> >>
> >> *jmap -dump:format=b,file=heap.bin <pid>*
> >>
> >>
> >>
> >> we get below error
> >>
> >>
> >>
> >> *<pid>: Not enough storage is available to process this command.*
> >
> > probably because you have set a large heap size.
>
> try:
>   jmap -J-Xmx512M -dump:format=b,file=heap.bin <pid>
>
> (You _might_ get away with 768M but better to be safe than sorry).
>
> I believe jmap is telling you that it doesn't have enough heap
> available to process tomcat's heap - which you have
> set at 512M. The default heap is typically quite low.
>
> >
> >> When Tomcat is started manually in console (using command “catalina.bat
> >> start”), we are able to take the heap dump.
> >
> > because you are probably not setting a heap size.
> >
> >> Is there any workaround which would allow to take heap dump when Tomcat
> >> running as windows service?
> >
> > make some more disk space available, sufficient to permit the heap to be
> > written to file.
> >
> >
> > p
> >
> >> Thanks & Regards,
> >>
> >> Aditi
> >>
> >
> >
> > --
> >
> > [key:62590808]
> >
>
>
>
> --
> Best Regards,
>
> Brett Delle Grazie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: How to get heap dump of Tomcat running as windows service.

Posted by Brett Delle Grazie <br...@gmail.com>.
On 12 September 2012 13:14, Pid <pi...@pidster.com> wrote:
> On 12/09/2012 11:02, Aditi Sinha wrote:
>> Hi,
>>
>>
>>
>> We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
>> service.
>>
>> When we try to get the heap  dump of Tomcat using the following command
>>
>>
>>
>> *jmap -dump:format=b,file=heap.bin <pid>*
>>
>>
>>
>> we get below error
>>
>>
>>
>> *<pid>: Not enough storage is available to process this command.*
>
> probably because you have set a large heap size.

try:
  jmap -J-Xmx512M -dump:format=b,file=heap.bin <pid>

(You _might_ get away with 768M but better to be safe than sorry).

I believe jmap is telling you that it doesn't have enough heap
available to process tomcat's heap - which you have
set at 512M. The default heap is typically quite low.

>
>> When Tomcat is started manually in console (using command “catalina.bat
>> start”), we are able to take the heap dump.
>
> because you are probably not setting a heap size.
>
>> Is there any workaround which would allow to take heap dump when Tomcat
>> running as windows service?
>
> make some more disk space available, sufficient to permit the heap to be
> written to file.
>
>
> p
>
>> Thanks & Regards,
>>
>> Aditi
>>
>
>
> --
>
> [key:62590808]
>



-- 
Best Regards,

Brett Delle Grazie

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to get heap dump of Tomcat running as windows service.

Posted by Pid <pi...@pidster.com>.
On 12/09/2012 11:02, Aditi Sinha wrote:
> Hi,
> 
> 
> 
> We have web server hosted on Tomcat 7.0.22. Tomcat is running as windows
> service.
> 
> When we try to get the heap  dump of Tomcat using the following command
> 
> 
> 
> *jmap -dump:format=b,file=heap.bin <pid>*
> 
> 
> 
> we get below error
> 
> 
> 
> *<pid>: Not enough storage is available to process this command.*

probably because you have set a large heap size.

> When Tomcat is started manually in console (using command “catalina.bat
> start”), we are able to take the heap dump.

because you are probably not setting a heap size.

> Is there any workaround which would allow to take heap dump when Tomcat
> running as windows service?

make some more disk space available, sufficient to permit the heap to be
written to file.


p

> Thanks & Regards,
> 
> Aditi
> 


-- 

[key:62590808]