Can't change tomcat 7 heap size
Set additionally export JAVA_OPTS="-Dcom.sun.management.jmxremote"
and use JConsole to inspect the tomcats memory consumption.
TOMCAT 7, Can't change the heap size
Check the setenv.sh
in tomcat/bin
, according to manual this should be the right place to put those params.
Another option, it depend on your OS tomcat package, may be that config param are overrided in /etc/conf.d/tomcat/
or /etc/tomcat
. Just check your init script and your catalina.sh to find where your settings are overrided.
Btw if you run a ps -ef | grep tomcat
you should see the full command line with arguments: this may give you an idea of how init script build the command, and so you can investigate where params are set.
Tomcat 7: How to set initial heap size correctly?
You must not use =
. Simply use this:
export CATALINA_OPTS="-Xms512M -Xmx1024M"
How to increase Tomcat Heap memory on windows
Please see detail:
- I use apache-tomcat-9.0.14-windows-x64.zip
- Sure use right java version
- Edit catalina.bat add set JAVA_OPTS=-Xms128m -Xmx1024m after setlocal
- Start Tomcat with startup.bat
- Check JVM with: start jconsole, select Tomcat, select insecure
- See XMS, XMX
If you want start Tomcat9w.exe, you need install service
Java.lang.OutOfMemory not solved when change the setenv.sh file in Tomcat 7
Runtime.getRuntime().maxMemory()
return the maximum amount of memory that JVM will attempt to use.
It return 1024M
when -Xmx1024M
. The array matrixArr
need to allocate 1024M*4
of memory. That's why you still got java.lang.OutOfMemory
exception after increasing JVM heap size.
How to increase Java heap space for a tomcat app
Your change may well be working. Does your application need a lot of memory - the stack trace shows some Image related features.
I'm guessing that the error either happens right away, with a large file, or happens later after several requests.
If the error happens right away, then you can increase memory still further, or investigate find out why so much memory is needed for one file.
If the error happens after several requests, then you could have a memory leak - where objects are not being reclaimed by the garbage collector. Using a tool like JProfiler
can help you monitor how much memory is being used by your VM and can help you see what is using that memory and why objects are not being reclaimed by the garbage collector.
Related Topics
How to Add .So File to the Java.Library.Path in Linux
Docker Bash Prompt Does Not Display Color Output
Gcc-Arm-Linux-Gnueabi Command Not Found
How to Fix the Rust Error "Linker 'Cc' Not Found" for Debian on Windows 10
Deleting a Folder from Svn Repository
Iterate Over Lines Instead of Words in a for Loop of Shell Script
Http Debugging Proxy for Linux and MAC
What's the Best Way to Distribute a Binary Application for Linux
Using 'Find -Perm' to Find When a Permission Is Not Set
How to Identify the Particular Linux Flavor via Command Line
Postgresql CSV Import from Command Line
Convert Binary Data to Hexadecimal in a Shell Script
Cmake:Set Environment Variables from a Script
How to Capture the Output of a Top Command in a File in Linux