Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:23 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
Bit of a shot in the dark here.

If I'm running an embedded version of Tomcat, that doesn't expose the usual configuration details, is there any way to find out from a running process what parameters it's running under?

Specifically, I've got a process running that is a tomcat process. I want to know what its Java memory allocations are, both maximum and initial. Is there any way to find out? From the Java console, perhaps?

Ta

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:27 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
Windows or Unix? ps aux on unix will do the trick. You're looking for the -Xmx command line parameter.


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:28 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69715
Location: Your Mum
Tomcat problems, eh? I know the feeling.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:29 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69715
Location: Your Mum
Blatent c/p
Quote:
To find out how much RAM is allocated already to your Tomcat instance, if you have Tomcat installed as a Windows service, you can run Regedit and look at:

HKEY_LOCAL_MACHINE
SOFTWARE
Apache Software Foundation
Procrun 2,0
Under that key will be all the tomcat service instances you have installed on that machine. If you expand an instance tree you will see another key named Parameters. Expand this and you will see a number of named values:

JvmMs - is the minimum memory, equivalent to -Xms
JvmMx - is the maximum memory equivalent to -Xmx
Options - any other java options you wish to set for this server.
When you run Tomcat as a service it calls the jvm.dll directly so anything you modify in one of the bat files will be disregarded. So you will need to set those options by changing those registry values. The default Tomcat configuration does not use any memory configuration. If you haven't set the -Xms or -Xmx parameters explicitly anywhere you will wind up with the JDK default which is 64M.

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:31 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
That won't work if some other process has started Tomcat, and Craster specifically said "embedded".


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:34 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
It's on Windows. Basically, I'm doing an idiots guide. I've set the -xmx and -xms parameters in the registry, and I'm doing a 'validation' step where I need to find a way of confirming that they've actually typed the reg keys correctly and that the running Tomcat instance is actually using those parameters.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 12:54 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
Just tell Task Manager to show the full command line. That should do it.


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 13:04 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
Hmm. Can't do that on 2003, but using WMIC from the command line to grab the list of running processes did the job. Cheers!

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: Random Apache Tomcat Question
PostPosted: Wed Aug 29, 2012 13:09 
User avatar

Joined: 30th Mar, 2008
Posts: 32624
Good oh.

For future reference, you can also connect to running JVMs from jConsole and get data out; but it's more long winded than just using the command line.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Columbo and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.