Basic question about Apache+Tomcat Memory usage

2001-09-07 Thread srini

hi users,
i have  this basic question in mind from so many days but din't get
an answer for it.
 when i try to execute a simple JSP or Servlet , generally first
time my CPU usage goes to 80-100%.I tried with default examples which comes
with Tomcat. where as i have seen big application which don't use that much
memory even u do some heavy jobs.
 Why is it so ???

 System configuration:
Pentium3900mHz processor   256MB Ram.
Operating system:  win2K
Tomcat 3.2.2

Thanks in advance.

-srini




Re: Basic question about Apache+Tomcat Memory usage

2001-09-07 Thread Craig R. McClanahan

Are you asking about CPU usage or memory usage?

For CPU, the first time you access a page (or whenever you update it),
Tomcat has to translate the page into Java and then compile it.  This is a
pretty CPU-intensive activity, but it only happens once.

For memory, there is a lot to understand about the way JVMs work -- but
basically, from the operating system point of view, the JVM will start out
at whatever you have configured as the minimum heap size, grow as it needs
to, and never give it back (although from *inside* the JVM there will be
free memory that can be reused for new Java object creation).  You can
control the overall memory usage with command line parameters -- see the
Java documentation for more info.

Craig


On Fri, 7 Sep 2001, srini wrote:

 Date: Fri, 7 Sep 2001 12:14:28 -0700
 From: srini [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Basic question about Apache+Tomcat Memory usage

 hi users,
 i have  this basic question in mind from so many days but din't get
 an answer for it.
  when i try to execute a simple JSP or Servlet , generally first
 time my CPU usage goes to 80-100%.I tried with default examples which comes
 with Tomcat. where as i have seen big application which don't use that much
 memory even u do some heavy jobs.
  Why is it so ???

  System configuration:
 Pentium3900mHz processor   256MB Ram.
 Operating system:  win2K
 Tomcat 3.2.2

 Thanks in advance.

 -srini






Re: Basic question about Apache+Tomcat Memory usage

2001-09-07 Thread srini

 ho sorry Craig i was talking about CPU usage. I know first time it
translates JSP page in to Java and compiles it. But is it that much
intensive to eat 80-100% of memory ??
Iam running my application on Apache+Tomcat. For many of the pages
it takes 90-100% even though they are not first time visiting pages. It has
Database connections. what is the problem ?? do i need to check the code or
what ...?

  Thnaks  Craig .

-srini


- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 12:10 PM
Subject: Re: Basic question about Apache+Tomcat Memory usage


 Are you asking about CPU usage or memory usage?

 For CPU, the first time you access a page (or whenever you update it),
 Tomcat has to translate the page into Java and then compile it.  This is a
 pretty CPU-intensive activity, but it only happens once.

 For memory, there is a lot to understand about the way JVMs work -- but
 basically, from the operating system point of view, the JVM will start out
 at whatever you have configured as the minimum heap size, grow as it needs
 to, and never give it back (although from *inside* the JVM there will be
 free memory that can be reused for new Java object creation).  You can
 control the overall memory usage with command line parameters -- see the
 Java documentation for more info.

 Craig


 On Fri, 7 Sep 2001, srini wrote:

  Date: Fri, 7 Sep 2001 12:14:28 -0700
  From: srini [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Basic question about Apache+Tomcat Memory usage
 
  hi users,
  i have  this basic question in mind from so many days but din't
get
  an answer for it.
   when i try to execute a simple JSP or Servlet , generally first
  time my CPU usage goes to 80-100%.I tried with default examples which
comes
  with Tomcat. where as i have seen big application which don't use that
much
  memory even u do some heavy jobs.
   Why is it so ???
 
   System configuration:
  Pentium3900mHz processor   256MB Ram.
  Operating system:  win2K
  Tomcat 3.2.2
 
  Thanks in advance.
 
  -srini
 
 






Re: Basic question about Apache+Tomcat Memory usage

2001-09-07 Thread Craig R. McClanahan



On Fri, 7 Sep 2001, srini wrote:

 Date: Fri, 7 Sep 2001 12:38:11 -0700
 From: srini [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: Basic question about Apache+Tomcat Memory usage

  ho sorry Craig i was talking about CPU usage. I know first time it
 translates JSP page in to Java and compiles it. But is it that much
 intensive to eat 80-100% of memory ??

If there is nothing higher priority that needs to run, don't you *want*
100% CPU usage, so the compile gets done faster?  :-)

 Iam running my application on Apache+Tomcat. For many of the pages
 it takes 90-100% even though they are not first time visiting pages. It has
 Database connections. what is the problem ?? do i need to check the code or
 what ...?


There's no way to give advice based on generalities here -- the only way
to figure out what inside your page is eating the time is to use tools
like OptimizeIt that will help you isolate the big CPU hogs.

   Thnaks  Craig .

 -srini


Craig



 - Original Message -
 From: Craig R. McClanahan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, September 07, 2001 12:10 PM
 Subject: Re: Basic question about Apache+Tomcat Memory usage


  Are you asking about CPU usage or memory usage?
 
  For CPU, the first time you access a page (or whenever you update it),
  Tomcat has to translate the page into Java and then compile it.  This is a
  pretty CPU-intensive activity, but it only happens once.
 
  For memory, there is a lot to understand about the way JVMs work -- but
  basically, from the operating system point of view, the JVM will start out
  at whatever you have configured as the minimum heap size, grow as it needs
  to, and never give it back (although from *inside* the JVM there will be
  free memory that can be reused for new Java object creation).  You can
  control the overall memory usage with command line parameters -- see the
  Java documentation for more info.
 
  Craig
 
 
  On Fri, 7 Sep 2001, srini wrote:
 
   Date: Fri, 7 Sep 2001 12:14:28 -0700
   From: srini [EMAIL PROTECTED]
   Reply-To: [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Subject: Basic question about Apache+Tomcat Memory usage
  
   hi users,
   i have  this basic question in mind from so many days but din't
 get
   an answer for it.
when i try to execute a simple JSP or Servlet , generally first
   time my CPU usage goes to 80-100%.I tried with default examples which
 comes
   with Tomcat. where as i have seen big application which don't use that
 much
   memory even u do some heavy jobs.
Why is it so ???
  
System configuration:
   Pentium3900mHz processor   256MB Ram.
   Operating system:  win2K
   Tomcat 3.2.2
  
   Thanks in advance.
  
   -srini
  
  
 
 






Re: Basic question about Apache+Tomcat Memory usage

2001-09-07 Thread Pier Fumagalli

srini [EMAIL PROTECTED] wrote:

 ho sorry Craig i was talking about CPU usage. I know first time it
 translates JSP page in to Java and compiles it. But is it that much
 intensive to eat 80-100% of memory ??

It seem to me you're confusing again CPU usage with memory... 80%/100% IS
the CPU percentile activity...

 I am running my application on Apache+Tomcat. For many of the pages
 it takes 90-100% even though they are not first time visiting pages. It has
 Database connections. what is the problem ?? do i need to check the code or
 what ...?

No, it means that the baby _is_ working... It's normal for a CPU to be used
when you process some data, the JVM and APACHE are using all the available
CPU power to deliver the response as soon as possible... If it's a peak
(meaning that after you hit the page the CPU goes back to your normal load
cycle) it's normal... If it stays up at 80% 100% all the time, then, there
is a problem...

Pier





Re: Basic question about Apache+Tomcat Memory usage

2001-09-07 Thread Jonathan Eric Miller

You mean the first time you access the JSP after starting Tomcat? This is
because the JSP has to be compiled into a class before it can be executed.

Jon

- Original Message -
From: srini [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 2:14 PM
Subject: Basic question about Apache+Tomcat Memory usage


 hi users,
 i have  this basic question in mind from so many days but din't
get
 an answer for it.
  when i try to execute a simple JSP or Servlet , generally first
 time my CPU usage goes to 80-100%.I tried with default examples which
comes
 with Tomcat. where as i have seen big application which don't use that
much
 memory even u do some heavy jobs.
  Why is it so ???

  System configuration:
 Pentium3900mHz processor   256MB Ram.
 Operating system:  win2K
 Tomcat 3.2.2

 Thanks in advance.

 -srini