Struts1.x application not releasing RAM after using it - java

i am working on Struts1.x web application and using weblogic server, when performing some processing on very huge data, it consume almost all the RAM but after completing or session timeout, it don't return the consumed RAM.
It never release the RAM until I stop the server or kill forcefully. wanted to know such scenario where the RAM utilization is not released after usage and if it can be solve by tuning weblogic paramter or by some other way.
using the following parameter in weblogic:
-Xms12g -Xmx12g -XX:MetaspaceSize=1G -XX:MaxMetaspaceSize=1G
-XX:NewRatio=3 -XX:SurvivorRatio=8 -XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+DisableExplicitGC
-XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled
-XX:+CMSScavengeBeforeRemark -XX:CMSInitiatingOccupancyFraction=68
-DBASE_CONFIG_LA=/data01/Lending_Analytics_weblogic/LendingAnalyticsPQM/config/
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError
-XX:+UseGCOverheadLimit -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2m -Xloggc:/data01/Lending_Analytics_weblogic/LendingAnalyticsPQM/GCLogs/gc.log
*** not able to find any GC issue after analyzing the GC logs.
*** fixed all the Memory Leak issue from the code through eclipse memory leak compiler

Related

Java 11 GC1 GC memory management issue

I need some guidance related to Java 11 GC algorithm for JVM. We are migrating our application from jdk 8 to Java11. We are seeing spikes in memory management with the new GC algorithm that is defaulted with Java11 ie., GC1. Earlier we used CMS. Earlier our JVM startup params for the GC as below:
Application Infrastructure : 8 core CPU, 16GB RAM Linux EC2 (c5.2xlarge)
JDK 8 : -d64 -server -Xms4g -Xmx12g -XX:NewRatio=1 -XX:SurvivorRatio=4 -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseConcMarkSweepGC -XX:ThreadStackSize=1024 -XX:+OptimizeStringConcat -XX:CMSInitiatingOccupancyFraction=70
Here we see the average memory usage at 4gb to 6gb when there is full load on the system.
Java11 : -server -Xms12g -Xmx12g -verbose:gc -Xlog:gc:gc.log -XX:+PrintGCDetails -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=30 -XX:G1ReservePercent=20 -XX:+UseStringDeduplication -Xlog:safePoint -XX:ThreadStackSize=1024 -XX:+OptimizeStringConcat
Here we see the average memory usage gradually increase and go up till 90% on full load and that's when the GC runs and frees up the space. Also, we do not see the memory usage coming down when there is no load or 0 load on the system. I read that this is the expected behavior of Gc1
Kindly Advice!
Application behavior is similar is both cases

Heap size: getRuntime().maxMemory() is much less than -Xmx parameter

This is my -xmx seting in IDEA
-server
-Xms512m
-Xmx8192m
-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
64bit system, 16GB memory.
I don't know why the result of Runtime.getRuntime().maxMemory() is much less than 8G. Actually, it does not change according to -xmx.
The program throws heap space after exceeding this value.
Anyone can help me?
This is my result of maxMemory(): 3803185152

Application not responding when GC runs

Our application runs 24*7 with heavy user load, recnlty we started having issues with system performance, application not responding, we had to restart JVM to get it back online while investigating we found out that JVM runs GC and at that time application slows down, sometime not even responding,
Below is our stats for GC during that time.
GC Heap
GC Summary
Looking at this data, is there any recommendations on what to look for or if any JVM configuration needs to be corrected?
Java Version is 7, GC settings are #jvm -XX:+UseConcMarkSweepGC -XX:-UseGCOverheadLimit -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintGCDateStamps -Xloggc:/opt/Server/logs/gclog.log -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Xms4096M -Xmx6144M -XX:PermSize=512M -XX:MaxPermSize=1024M -XX:ErrorFile=./log/error.log -XX:HeapDumpPath=./log/heap_dump.hprof –

GC Log roation with compression paramewter in JDK 8

I am trying GC log rotation in JDK 8.So I have achieved it by using below GC Log JVM parameter
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:verbose-jdk8-gc.log -XX:+PrintGCDateStamps
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=1k
But Now I want that This should also compressed when Rotation is done.
So is there any JVM Parameter in JDK 8 for compression of GC Log ?
Is there any one who can help me.
On Linux, you can use logroate: https://linux.die.net/man/8/logrotate to manage the rotation and compression of JVM gc log.

intellij idea ignoring MaxPermSize run parameter

It seems something strange happening with my intllij idea. I'm trying to launch project in intellij and constantly getting java.lang.OutOfMemoryError: PermGen space regardless the value I set for -XX:MaxPermSize (tried from 256 to 4096, no effect). It seems intellij doesn't use it at all. Application get OutOfMemory exception when java process acquares approximately 700mb of memory. Just to compare: this project gets launched in eclipse and in the end it consumes about 4gb of memory.
Is there a bug regarding this or I'm the only who faces this issue? Could somebody, please, point me at my mistakes?
ADDITION
Content of my idea64.exe.vmoptions
-Xms1024m
-Xmx2048m
-XX:MaxPermSize=500m
-XX:+UseConcMarkSweepGC
-XX:ReservedCodeCacheSize=128m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseCodeCacheFlushing
-XX:+UseParallelGC
-XX:+UseAdaptiveSizePolicy
-XX:-UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50

Categories

Resources