Failed to change Tomcat 5.5 JVM Memory settings (Linux server) - java

I want to increase the JVM memory settings for my Tomcat 5.5 instance (on Linux server with 1.8 gigs of memory).
Current JVM Status:
Free memory: 15.60 MB Total memory: 26.00 MB Max memory: 405.37 MB
I just can't get these settings to budge. I tried the following:
Added the following statement to "setenv.sh" in /tomcat/bin:
export JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
Added the following statement to "setenv.sh" in /tomcat/bin:
export CATALINA_OPTS="-server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
Added the following statement to "setenv.sh" in /tomcat/bin:
JAVA_OPTS="-Xmx1024m -Xms512m -server"
export JAVA_OPTS
Added the following statement to "catalina.sh" in /tomcat/bin:
CATALINA_OPTS="-server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
Added the following statement to "catalina.sh" in /tomcat/bin:
JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m"
NONE of these changes made any impact on the JVM settings.
I have exhausted all options identified from various support sites, including:
How to tune Tomcat 5.5 JVM Memory settings without using the configuration program and
http://wiki.razuna.com/display/ecp/Adjusting+Memory+Settings+for+Tomcat
Thanks in advance.

Related

Intellij JBoss - Initial heap size set to a larger value than the maximum heap size

I am using IntelliJ 2020.1 Ultimate and have a JBoss 7.0.2 server that I want to run from IntelliJ.
I have added it as a configuration:
But when I try start the server, I get the following error:
IDEA.app/Contents/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-stdlib.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-reflect.jar:/Applications/IntelliJ
IDEA.app/Contents/plugins/Kotlin/lib/kotlin-plugin.jar"
org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 64088
4a7ed3b5-cfb6-4196-b997-396c16d8c06f
/Users/richardmarais/Library/Caches/JetBrains/IntelliJIdea2020.1/compile-server
Picked up JAVA_TOOL_OPTIONS: -Dhttps.protocols=TLSv1.2 -Xmx2048m
-XX:MaxPermSize=1024m -Xms2048m OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 Error occurred
during initialization of VM Initial heap size set to a larger value
than the maximum heap size
My idea.vmoptions are the default values:
-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
Question
Do you know how I can fix the above error to get JBoss to start?
You don't need to set any global environment variables to patch the VM options.
Unset JAVA_TOOL_OPTIONS and specify the proper VM Options in the Run/Debug configuration for the server:
-Xms256m -Xmx2048m -XX:MaxPermSize=512m
It should be more than enough for any project. I doubt that you really need 5GB initial heap size.
Also note that IntelliJ IDEA .vmoptions doesn't affect the options for the apps that you start from the IDE.
I fixed this by doing this.
open -a TextEdit.app ~/.bash_profile
then:
export JAVA_TOOL_OPTIONS="-Dhttps.protocols=TLSv1.2 -Xmx4096m -Xms128m"

playframework change heap size

My PlayFramework app always starts with only 256mb ram. Is there a way to increase the default ram?
I start my application with sbt run
Thanks in advance
I got this error java.lang.OutOfMemoryError: Java heap space
You can edit sbt\conf\sbtconfig.txt and set -Xmx1024M for sbt globally.
Problem sovled:
"C:\Program Files\Java\jdk1.8.0_144\bin\java.exe" -Dfile.encoding=UTF8 -Djline.terminal=none -Dsbt.log.noformat=true -Dsbt.global.base=C:\Users\USER\AppData\Local\Temp\sbt-global-pluginstub -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=2048M -classpath C:\Users\User\.IntelliJIdea2018.3\config\plugins\Scala\launcher\sbt-launch.jar xsbt.boot.Boot "project ji_approvalmachine_processes" run
Its not generic solution. But you can use relative paths or enviroment variables instead of the absolute path.

"Failed to create jvm error code -1" whenever I am launching android studio

Hello friends I am facing an error message whenever I am launching android studio.The error is failed to create jvm error code -1 .See the below image for the complete error message
I tried to find solution on Google, but I didn't find any solution.
Thanks
My laptop config is
win7 64bit
i5 intel
8 gb 6 gb ram
1 tb hard disk
My android studio vmopetion file is
#
# *DO NOT* modify this file directly. If there is a value that you would like to override,
# please add it to your user specific configuration file.
#
# See http://tools.android.com/tech-docs/configuration
#
-Xms256m
-Xmx1280m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=
-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio
my java version is 1.8.0_91
I have the same problem which triggered after i changed vmoptions file.This worked for me
Go to C:\Users\ username \.androidStudio\
2.Find the studio.exe.vmoptions (or studio64.exe.vmoptions) and simply type
-Xmx4g (or -Xmx2g if you want to allocate 2GB RAM)
Here 4g is for allocating 4GB RAM to android studio.
Open file located at
/Applications/Android\ Studio.app/Contents/bin/studio.vmoptions
Change the content to
-Xms128m
-Xmx4096m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=200m
-XX:+UseCompressedOops
Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. Your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.
Save the studio.vmoptions file and restart Android Studio.

Tomcat 8 limit memory

I installed Tomcat 8 with Java 8 on VPS server with 1024 RAM. But when I deploy war package I get error for memory.
I tried to limit the allocated memory with this setenv.sh script:
#! /bin/sh
export JAVA_OPTS="-Djava.awt.headless=true -server -Xms48m -Xmx1024M -XX:MaxPermSize=512m
But I get this error when I start Tomcat:
[root#ip-172-31-28-148 bin]# ./shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-8.0.26
Using CATALINA_HOME: /opt/apache-tomcat-8.0.26
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.26/temp
Using JRE_HOME: /
Using CLASSPATH: /opt/apache-tomcat-8.0.26/bin/bootstrap.jar:/opt/apache-tomcat-8.0.26/bin/tomcat-juli.jar
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
[root#ip-172-31-28-148 bin]#
Do you have any idea what is the proper way to limit Java to use 512 MB RAM memory?
It's normal, the system property PermSize and MaxPermSize have been removed in Java8 and their use raise a warning.
You could use MaxMetaspaceSize instead but your question is not clear. With PermSize, your reduce the memory allocated to the Permanent Generation, objects which are needed by the JVM and your container at all time.
If you want to reduce the memory used by your JVM (only the heap --> arrays and instances), you should use Xms (size at start) and Xmx (max size).
For example :
-Xms256M
-Xmx1024M

PermGen settings not taking effect

I'm trying to increase the amount of PermGen space my application has to avoid some PermGen errors.
I've tried exporting both JAVA_OPTS and MAVEN_OPTS as
-Xms1024m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=2048m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
But jconsole still shows the "CMS Perm Gen" maximum to be:
Max: 83,968 kbytes
and the application still runs out of PermGen space when it hits this.
have you tried adding those options to your pom - under the surefire plugin configuration as you have to tell surefire about these opts explicitly
<argLine>-Xms1024m -Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=2048m -XX:+CMSClassUnloadingEnabled</argLine>
According your comments you are starting something like cargo plugin. You need to look at the cargo plugin configuration to pass additional VM args, or directly in the script launching tomcat.
The JAVA_OPTS are applied to the launched app when using maven-exec-plugin with goal java

Categories