Re: Increasing Heap Size and Max Perm Size

2009-08-19 Thread Daniele Development-ML
The JVM actually recognises that the value being set/asked for is 100 as
when I shut it down, I get a message saying that a JVM with the specified
100m of memory cannot be created.
On Tue, Aug 18, 2009 at 11:48 PM, André Warnier a...@ice-sa.com wrote:

 Daniele Development-ML wrote:

 Hi all,

 I'm trying to increase the sizes of the heap and of the max perm by
 passing
 the options with the values (in catalina.sh)

 JAVA_OPTS=$JAVA_OPTS -Xmx=100m -XX:MaxPermSize=350m
 -Dfile.encoding=UTF-8

  Try without the = signs ? -Xmx100m


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




Re: Increasing Heap Size and Max Perm Size

2009-08-19 Thread Daniele Development-ML
Forgot to mention that when I try with the following command:
java -Xms512m -Xmx750m

it does succeed in creating the JVM - differently (but obviously), if I try:

java -Xms512m -Xmx6750m

it fails (as expected).

I don't understand why I get different behaviour passing this option the JVM
when starting Tomcat, and when I give directly to the JVM - I have tried
this also with a simple Java main class that instantiates big arrays.

Any hit/suggestions are very welcomed.

Dan



On Wed, Aug 19, 2009 at 11:05 AM, Daniele Development-ML 
daniele@googlemail.com wrote:

 The JVM actually recognises that the value being set/asked for is 100 as
 when I shut it down, I get a message saying that a JVM with the specified
 100m of memory cannot be created.

 On Tue, Aug 18, 2009 at 11:48 PM, André Warnier a...@ice-sa.com wrote:

 Daniele Development-ML wrote:

 Hi all,

 I'm trying to increase the sizes of the heap and of the max perm by
 passing
 the options with the values (in catalina.sh)

 JAVA_OPTS=$JAVA_OPTS -Xmx=100m -XX:MaxPermSize=350m
 -Dfile.encoding=UTF-8

  Try without the = signs ? -Xmx100m


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





Re: Increasing Heap Size and Max Perm Size

2009-08-19 Thread Markus Schönhaber
Daniele Development-ML:

 Forgot to mention that when I try with the following command:
 java -Xms512m -Xmx750m
 
 it does succeed in creating the JVM
[...]
 I don't understand why I get different behaviour passing this option the JVM
 when starting Tomcat, and when I give directly to the JVM

From your OP:
 JAVA_OPTS=$JAVA_OPTS -Xmx=100m -XX:MaxPermSize=350m -Dfile.encoding=UTF-8

You get different behaviour because you're passing *different* options
to the VM.
Moreover, as you've been told by the VM and André, -Xmx=100m isn't a
valid way to set the VM's maximum heap size.

And BTW: instead of changing a Tomcat-provided script like catalina.sh
to set your options you should create (or edit) setenv.sh and set the
desired env vars there.

-- 
Regards
  mks

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



Re: Increasing Heap Size and Max Perm Size

2009-08-19 Thread André Warnier

Daniele Development-ML wrote:
..
Just a detail about the usage of the list : when you respond, respond to 
the list only, unless specifically asked to post to the one person in 
particular.
Since we are all subscribed to the list, we all get all the list 
messages anyway.  If you in addition send to someone in particular, that 
person then gets the message twice, which is a mild annoyance.


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



Re: Increasing Heap Size and Max Perm Size

2009-08-19 Thread Daniele Development-ML
Hey Chuck,
I'm sure you are right - and that it was what I was following at the
beginning. And the resulting situation was what I describe above: getting a
error message in the catalina.out and my application unable to load (404 at
the application URL). In addition to this, I got also an explicit (on the
console) message reporting this problem when shutting down Tomcat.

To understand it better, I ran jconsole locally and I could notice that the
heap was not set as indicated in the option.

Differently, when using it with the CATALINA_OPTS, things work and also
jconsole indicates that the heap size is the one specifies - except that is
converted in bytes - but it does match.

I don't know why - and I'm not even sure how good (style-wise) this
approach is - but I'm reporting my experience.

If anybody could suggest some motivation or direction for investigation on
this, I'm glad to try them.

Dan

On Wed, Aug 19, 2009 at 2:08 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Daniele Development-ML [mailto:daniele@googlemail.com]
  Subject: Re: Increasing Heap Size and Max Perm Size
 
  Practically, everything works when setting the above options
  through CATALINA_OPTS variable.

 Someone's confused.  JAVA_OPTS works fine, but it affects both the startup
 and shutdown scripts.  CATALINA_OPTS affects only the startup script.  The
 last posting in the referenced article is incorrect.

 And despite your protestations, having an equals sign in the -Xmx parameter
 has never been allowed on a JVM supplied by Sun, and will cause an immediate
 JVM initialization failure.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


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




Re: Increasing Heap Size and Max Perm Size

2009-08-19 Thread André Warnier

Daniele Development-ML wrote:

Found a solution here:
http://www.coderanch.com/t/85725/Tomcat/heap-space-setting-Tomcat-Linux

http://www.coderanch.com/t/85725/Tomcat/heap-space-setting-Tomcat-LinuxPractically,
everything works when setting the above options through CATALINA_OPTS
variable.


Daniele,
a solution found here or there may work, and may still be a bad solution 
from an overall point of view.
Modifying catalina.sh means that at the next Tomcat update, it will 
probably be lost, and you will wonder why something that worked with 
Tomcat 6.0.18 does not work anymore with 6.0.20, but I haven't changed 
anything  !.
The best place to set environment values is the Tomcat/bin/setenv.sh 
(create if not there), which does not get overwritten by a new Tomcat 
version, and is called (if it exists) by catalina.sh, here :


if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
  . $CATALINA_BASE/bin/setenv.sh
elif [ -r $CATALINA_HOME/bin/setenv.sh ]; then
  . $CATALINA_HOME/bin/setenv.sh
fi

Now, in order to really see what happens, you need, on your platform, to 
look first at the script which starts Tomcat, probably /etc/init.d/tomcatxx.
This script will do some setup, then probably call 
(tomcat_home)/bin/startup.sh, which in turn calls 
Tomcat_home/bin/catalina.sh, which in turn calls 
(tomcat_home)/bin/setenv.sh if it exists.
read those scripts, understand what they are doing and when, and then 
put your environment vars in the right place.
You cannot rely on some receipe written by someone on some forum for 
some particular situation, or on some receipe found in a book that was 
written 5 years ago for a version of Tomcat since unsupported.


There is a standard file in the Tomcat distribution called 
RUNNING.txt.  On my Debian system, it is in (tomcat_home)/docs. 
Depending on your Linux version, it may have been moved somewhere else.

Regardless, it is a good place to start.
In my Debian distribution, there is also, at the same location, a file 
called README.Debian, which explains in some detail how the Debian 
packager for Tomcat re-organised the Tomcat files, so that they fit 
better in the general Debian host setup logic.

I would assume other distributions do the same.
Read these files, they are full of precise and logical information.

Unless you understand how it all works together, you are condemned to 
re-live the same kind of problems again each time you make a change, 
because you will probably make it in the wrong spot.





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



Increasing Heap Size and Max Perm Size

2009-08-18 Thread Daniele Development-ML
Hi all,

I'm trying to increase the sizes of the heap and of the max perm by passing
the options with the values (in catalina.sh)

JAVA_OPTS=$JAVA_OPTS -Xmx=100m -XX:MaxPermSize=350m -Dfile.encoding=UTF-8

but the VM cannot be created and from the catalina.out file I get this
printout:

Invalid maximum heap size: -Xmx=100m
Could not create the Java virtual machine.

The Tomcat home page can be accessed (port number 8080), but the home page
of my application gives the following error:

“localhost” refused the connection.

Likely causes of the problem are

* the service http-alt isn't started.
  Try to start it using the Services Configuration Tool in System 
Control Centre, or

* the port number 8080 is wrong.

Any hints/suggestions about this are much appreciated.

My OS is Debian Linux.

Thanks!

Dan


Re: Increasing Heap Size and Max Perm Size

2009-08-18 Thread Leon Rosenberg
the system actually gave you the answer:
Invalid maximum heap size: -Xmx=100m
Could not create the Java virtual machine.

If you are going to give the PermSpace 350M, you must have a lot of
memory, so giving half gb for heap won't heart:
JAVA_OPTS=$JAVA_OPTS -Xmx=512m -XX:MaxPermSize=350m -Dfile.encoding=UTF-8

regards
Leon

(Of course you can give less memory, like 256m or 128m).

On Tue, Aug 18, 2009 at 8:48 PM, Daniele
Development-MLdaniele@googlemail.com wrote:
 Hi all,

 I'm trying to increase the sizes of the heap and of the max perm by passing
 the options with the values (in catalina.sh)

 JAVA_OPTS=$JAVA_OPTS -Xmx=100m -XX:MaxPermSize=350m -Dfile.encoding=UTF-8

 but the VM cannot be created and from the catalina.out file I get this
 printout:

 Invalid maximum heap size: -Xmx=100m
 Could not create the Java virtual machine.

 The Tomcat home page can be accessed (port number 8080), but the home page
 of my application gives the following error:

 “localhost” refused the connection.

 Likely causes of the problem are

    * the service http-alt isn't started.
      Try to start it using the Services Configuration Tool in System 
 Control Centre, or

    * the port number 8080 is wrong.

 Any hints/suggestions about this are much appreciated.

 My OS is Debian Linux.

 Thanks!

 Dan


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



Re: Increasing Heap Size and Max Perm Size

2009-08-18 Thread André Warnier

Daniele Development-ML wrote:

Hi all,

I'm trying to increase the sizes of the heap and of the max perm by passing
the options with the values (in catalina.sh)

JAVA_OPTS=$JAVA_OPTS -Xmx=100m -XX:MaxPermSize=350m -Dfile.encoding=UTF-8


Try without the = signs ? -Xmx100m

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