Re: RAM usage of Linux-based Tomcat server

2004-08-31 Thread Jacob Kjome
At 10:57 PM 8/30/2004 -0700, you wrote:
I'm not worried about the transient memory used by the
Tomcat instance for it to serve servlets.
But I'm worried about the memory permanently allocated
for a Tomcat instance. Eg. A servlet in a particular
Tomcat instance, may load the entire database into the
memory for efficiency reasons. Now this Tomcat
instance requires X amount of memory to keep the
database and all the stuff related to that Tomcat
instance (except transient memory) to keep them in
memory. And it requires additional variable amount of
transient memory to serve it, that depends on the
demand for that Tomcat instance.
What I need to know is can I restrict the size of X?
If the memory allocated permanently to a particular
Tomcat instance cannot be restricted, Can I restrict
the total memory allocation (ie. permanent + transient
memory) for that Tomcat instance?
The VM starts up with a default of 64 meg of RAM Max regardless of physical 
memory.  You can increase this using -Xmx (with the Sun VM).  For 
example...  java -Xmx 256m

Any out of memory errors you get are because the amount of memory needed by 
the application exceeds the maximum memory barrier of the VM.  The only way 
around this is to get rid of memory leaks and/or increase the maximum 
memory for the VM.

look up -Xmx on Google for more info
Jake 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RAM usage of Linux-based Tomcat server PART2

2004-08-31 Thread pete
Adding a question to this note:

I have a maximum heap size of 768mb, and for a freshly started server, it
sits at 65mb. Throughout the day, it works itself near the max. Users
finish at 7pm, and first thing in the morning the server has not reclaimed
*any* memory - i.e. if I want to stop Tomcat running out of memory and
crashing, I need to restart the server every morning.
Is this solely down to the app or what? I am running Tomcat 5.0.18,
(shortly to be upgraded to 5.0.27) could issues with Tomcat .18 be causing
this (there are some memory related notes in the Tomcat CHANGELOG).
Thanks,
Pete.



 At 10:57 PM 8/30/2004 -0700, you wrote:
I'm not worried about the transient memory used by the
Tomcat instance for it to serve servlets.

But I'm worried about the memory permanently allocated
for a Tomcat instance. Eg. A servlet in a particular
Tomcat instance, may load the entire database into the
memory for efficiency reasons. Now this Tomcat
instance requires X amount of memory to keep the
database and all the stuff related to that Tomcat
instance (except transient memory) to keep them in
memory. And it requires additional variable amount of
transient memory to serve it, that depends on the
demand for that Tomcat instance.

What I need to know is can I restrict the size of X?

If the memory allocated permanently to a particular
Tomcat instance cannot be restricted, Can I restrict
the total memory allocation (ie. permanent + transient
memory) for that Tomcat instance?

 The VM starts up with a default of 64 meg of RAM Max regardless of
 physical  memory.  You can increase this using -Xmx (with the Sun VM).
 For  example...  java -Xmx 256m

 Any out of memory errors you get are because the amount of memory
 needed by  the application exceeds the maximum memory barrier of the
 VM.  The only way  around this is to get rid of memory leaks and/or
 increase the maximum  memory for the VM.

 look up -Xmx on Google for more info

 Jake


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED] For
 additional commands, e-mail: [EMAIL PROTECTED]


==
This email was sent by Ethicalwebsites.co.uk.
   Ethicalwebsites.co.uk - Internet Solutions for the UK
http://www.ethicalwebsites.co.uk/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RAM usage of Linux-based Tomcat server

2004-08-31 Thread Sagara Wijetunga

--- Jacob Kjome [EMAIL PROTECTED] wrote:

 At 10:57 PM 8/30/2004 -0700, you wrote:
 I'm not worried about the transient memory used by
 the
 Tomcat instance for it to serve servlets.
 
 But I'm worried about the memory permanently
 allocated
 for a Tomcat instance. Eg. A servlet in a
 particular
 Tomcat instance, may load the entire database into
 the
 memory for efficiency reasons. Now this Tomcat
 instance requires X amount of memory to keep the
 database and all the stuff related to that Tomcat
 instance (except transient memory) to keep them in
 memory. And it requires additional variable amount
 of
 transient memory to serve it, that depends on the
 demand for that Tomcat instance.
 
 What I need to know is can I restrict the size of
 X?
 
 If the memory allocated permanently to a particular
 Tomcat instance cannot be restricted, Can I
 restrict
 the total memory allocation (ie. permanent +
 transient
 memory) for that Tomcat instance?
 
 The VM starts up with a default of 64 meg of RAM Max
 regardless of physical 
 memory.  You can increase this using -Xmx (with the
 Sun VM).  For 
 example...  java -Xmx 256m
 
 Any out of memory errors you get are because the
 amount of memory needed by 
 the application exceeds the maximum memory barrier
 of the VM.  The only way 
 around this is to get rid of memory leaks and/or
 increase the maximum 
 memory for the VM.
 
 look up -Xmx on Google for more info
 
 Jake 
 

Limiting memory for the JVM looks like solves my
issue. Can I run different JVM per Tomcat instance on
a single server?

Sagara



___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: RAM usage of Linux-based Tomcat server

2004-08-30 Thread Sagara Wijetunga

--- Shapira, Yoav [EMAIL PROTECTED] wrote:

 
 Hi,
 
 1. Is it possible to know how much RAM is used by
 servlets by per domain basis?
 
 2. Is it possible to specify the maximum RAM could
 be
 used by per domain basis?
 
 The domain is as example.com, my-domain.com, etc.
 
 Pretty much no to both questions if you have them
 within the same Tomcat
 instances (e.g. two Host elements), yes to both
 questions if you have
 separate Tomcat instances for your domains.  And
 it's not a Tomcat
 limitation or feature, it's a JVM memory tracking
 issue.
 

Hi, Yoav, thanks for the reply.

I'm sorry I was not detailed enough.

I'm not using Tomcat yet, but thinking to use Tomcat
to offer Java/Servlets facility for couple of
different domains hosted on one Linux-based physical
server.

Since the servlet resides in the RAM once it is
loaded, the memory consumption and possible abuse is
my concern. Therefore, allocating RAM and limiting to
the allocated amount for different domain is what I'm
interested. Thereby, I can install sufficient physical
RAM in the server.

I'm interested to know more about the Tomcat instances
method you suggested. I have following queries
regarding it and could you help me to understand it
further?

1. Is it possible to run multiple Tomcat instances on
the same machine?

2. How much RAM (in roughly) is required for a single
or additional Tomcat instance without any servlet
loaded? Assume we use latest SUN Javasoft JVM and
latest Tomcat. 

3. Once the RAM limit is specified to a particular
Tomcat instance, what happens if they exceed the
limit? Does it still continue to allocate RAM or does
it give a run-time error?

4. Could you kindly explain (in very brief) where and
how do I specify the RAM limit?

5. What are the issues I should be aware of and keep
in mind when having multiple Tomcat instances on the
same server? 

Kind regards
Sagara








___
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RAM usage of Linux-based Tomcat server

2004-08-30 Thread QM
On Mon, Aug 30, 2004 at 08:37:24PM -0700, Sagara Wijetunga wrote:
: Since the servlet resides in the RAM once it is
: loaded, the memory consumption and possible abuse is
: my concern.

There's much more to memory in a Java webapp than just the servlets.
Read on:


: 1. Is it possible to run multiple Tomcat instances on
: the same machine?

Yes.  Please refer to the Tomcat docs on how to do this.


: 2. How much RAM (in roughly) is required for a single
: or additional Tomcat instance without any servlet
: loaded? Assume we use latest SUN Javasoft JVM and
: latest Tomcat. 

Try not to think of individual servlets; think of the webapp as a whole.
You must load-test and profile your app to see how much memory it will
use in a peak situation because no two webapps are the same.  (i.e.
there's no way someone who's never seen your app can give reliable
numbers.  It's all up to you.)


: 3. Once the RAM limit is specified to a particular
: Tomcat instance, what happens if they exceed the
: limit? Does it still continue to allocate RAM or does
: it give a run-time error?

This has more to do with the JVM than with Tomcat.  (Tomcat runs within
the JVM.)  You'd do well to read up on the specifics, but usually the
JVM will throw an OutOfMemoryException, in which case it's up to you to
repeat step 2 and profile/size.


: 4. Could you kindly explain (in very brief) where and
: how do I specify the RAM limit?

Please see the Tomcat docs, or review the archives.  This comes up a
*lot*.


: 5. What are the issues I should be aware of and keep
: in mind when having multiple Tomcat instances on the
: same server? 

The same considerations as with any other app: CPU and memory resources.
Disk space isn't an issue (webapps, not counting the logs, don't change
size at runtime) and it's a very, very rare event for a rogue JVM call
to take out other processes on the machine or cause a hard crash.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RAM usage of Linux-based Tomcat server

2004-08-30 Thread Sagara Wijetunga
--- QM [EMAIL PROTECTED] wrote:

 On Mon, Aug 30, 2004 at 08:37:24PM -0700, Sagara
 Wijetunga wrote:
 : Since the servlet resides in the RAM once it is
 : loaded, the memory consumption and possible abuse
 is
 : my concern.
 
 There's much more to memory in a Java webapp than
 just the servlets.
 Read on:
 
 
 : 1. Is it possible to run multiple Tomcat instances
 on
 : the same machine?
 
 Yes.  Please refer to the Tomcat docs on how to do
 this.
 
 
 : 2. How much RAM (in roughly) is required for a
 single
 : or additional Tomcat instance without any servlet
 : loaded? Assume we use latest SUN Javasoft JVM and
 : latest Tomcat. 
 
 Try not to think of individual servlets; think of
 the webapp as a whole.
 You must load-test and profile your app to see how
 much memory it will
 use in a peak situation because no two webapps are
 the same.  (i.e.
 there's no way someone who's never seen your app can
 give reliable
 numbers.  It's all up to you.)
 
I'm not thinking at servlet level, not even at web-app
level. I'm thinking at Tomcat instance (Tomcat sever)
level. I understand each Tomcat instance can have
multiple web-apps and each web-app can have multiple
servlets? Am I wrong?

I'm not worried about the transient memory used by the
Tomcat instance for it to serve servlets.

But I'm worried about the memory permanently allocated
for a Tomcat instance. Eg. A servlet in a particular
Tomcat instance, may load the entire database into the
memory for efficiency reasons. Now this Tomcat
instance requires X amount of memory to keep the
database and all the stuff related to that Tomcat
instance (except transient memory) to keep them in
memory. And it requires additional variable amount of
transient memory to serve it, that depends on the
demand for that Tomcat instance.

What I need to know is can I restrict the size of X?

If the memory allocated permanently to a particular
Tomcat instance cannot be restricted, Can I restrict
the total memory allocation (ie. permanent + transient
memory) for that Tomcat instance?

 : 3. Once the RAM limit is specified to a particular
 : Tomcat instance, what happens if they exceed the
 : limit? Does it still continue to allocate RAM or
 does
 : it give a run-time error?
 
 This has more to do with the JVM than with Tomcat. 
 (Tomcat runs within
 the JVM.)  You'd do well to read up on the
 specifics, but usually the
 JVM will throw an OutOfMemoryException, in which
 case it's up to you to
 repeat step 2 and profile/size.
 

Does this OutOfMemoryException means it ran out of
physical memory or there are still lot more physical
memory available but the limit specified to the Tomcat
instance exceeded? 
 
Kind regards
Sagara




__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]