I just moved from grails 2.4.3 to grails 2.5.6 and from Java 7 to Java 8.
I'm trying to set optimal metaspace size in my app.
Actual metaspace size has big impact on application performance:
Used metaspace and response avg time:
200 MB - 339 ms
300 MB - 380 ms
400 MB - 430 ms
500 MB - 460 ms
600 MB - 530 ms
Metaspace is growing from application start to 620MB in 90 minutes.
This is my actual gc settings:
-Xms14G -Xmx14G\
-XX:+UseG1GC\
-XX:ParallelGCThreads=8\
-XX:ConcGCThreads=4\
-XX:MaxGCPauseMillis=200\
-XX:+UseLargePages\
-XX:+UseLargePagesInMetaspace\
-XX:+AlwaysPreTouch\
-XX:InitialBootClassLoaderMetaspaceSize=512M\
-XX:MetaspaceSize=512M\
-XX:MinMetaspaceExpansion=8M\
-XX:MaxMetaspaceExpansion=32M\
-XX:+UseStringDeduplication\
-XX:+ParallelRefProcEnabled\
-XX:-TieredCompilation\
When MaxMetaspaceSize was set to 512M then after few hours of running my app is slowing down 1 or 2 times for hour. Respons time is around 10 seconds then.
Anyone had such problem? In yours applications metaspace has such impact on performance?
Have you profiled your app?
I'd say that Metaspace garbage collection was involved here. It collects dead classes and classloaders and it's triggered once the class metadata usage reaches the MaxMetaspaceSize (which was narrowed by -XX:MaxMetaspaceSize).
Related
In my Flink application I see that Managed Memory is getting being utilized 100% i.e. 512 MB of 512 MB, Even after increasing the size of Memory to 1 GB, I see instantly it shows memory consumption as 100% i.e. 0.96GB of .96GB . I am not understanding why it is happening like this, can someone please help me here?
I have tried in UAT and Preview environment.
I'm looking to find way to reduce latencies / higher response time at P99. The application is running on Jboss application server. Current configuration of the system is 0.5 core and 2 GB memory.
Suspecting low TPS might be the reason for higher P99's because current usages of the application at peak traffic is 0.25 core, averaging "0.025 core". And old gen GC times are running at 1s. Heap setting -xmx1366m -xms512m, metaspace at 250mb
Right now we have parallel GC policy, will G1GC policy help?
What else should I consider?
Environment: Windows Server 2012 and IIS 8.5
I have been observing slow performing transactions during load tests even if CPU utilization was < 60% and Memory utilization < 50% . I tried the following settings on IIS Manager, but No improvement was observed.
Threads Per Processor Limit - Increased from 25 to 50
minBytesPerSecond - Reduced from 240 to 0
Max Worker Processes - Increased from 1 to 2 and 5
Please help me with any other IIS settings that my improve performance.
disclaimer - I am running this on a mid 2012 macbook air i7-3667U and 8gb ram with the 64bit jvm.
Running the test suite for an application lein t is running at what I would consider an abnormally slow speed. Most of the tests involve mongo db (creating and dropping tables/collections). I have moved to monngodb enterprise which allows running in memory. As I assumed that the bottleneck was the db io.
with a mongo.conf
storage:
engine: inMemory
dbPath: /Users/beoliver/data/testdb
inMemory:
engineConfig:
inMemorySizeGB: 1
mongo is started with the flag --conf ~/path/to/mongo.conf
I added the java flags to the project
:jvm-opts ["-XX:-OmitStackTraceInFastThrow" "-Xmx4g" "-Xms1g"]
to try and avoid extra swaps.
This appeared to fix the issue and the tests ran as:
time lein t
...
lein t 238.71s user 8.72s system 59% cpu 6:57.92 total
This is reasonable compared with the results from other team members.
But then re-running the tests again the speed is back to the original (half and hour mark).
lein t 252.53s user 13.76s system 16% cpu 26:52.45 total
cpu usage peaks at about 50% but for the most part is around <5% (this includes times when it idles at <1%)
Real memory size: 1.55 GB
Virtual memory size : 8.08 GB
Shared Memory Size: 18.0 MB
Private Memory Size : 1.67 GB
Has anyone had similar experiences? Suggestions? Is there a good way of profiling - better than starting at Activity monitor?
My product has 256 MB of RAM. I have upgrade java 6 to java 8.
Then I started facing memory related issue with java 8.
memory consumption is incresing by the time with Java 8
With same code, memory consumption is stable with java 6
I have explored so much regarding metaspace,java8 and found below metaspace parameters.
I have tried below combinations and got out of memory error
1.MaxMetaspaceSize 50M
MaxMetaspaceFreeRatio 60M
MinMetaspaceFreeRatio 50M
2.MaxMetaspaceSize 30M
3.MaxMetaspaceSize 40M
4.MaxMetaspaceSize 50M
5.MaxMetaspaceSize 80M
But after 2 to 3 hours ,outofmemory metaspace error raised.
Can someone explain what the metaspace options MaxMetaspaceSize,MaxMetaspaceFreeRatio ,MinMetaspaceFreeRatio are?
How do I decide what the right size is?
what is the correct combination of these values to avoid outofmemory instance in production and reduce memory consumption ?
The issue is resolved.
Found that there are known issue with JAXB.
Used stringbuffer instead of string
Removed unnecessary instance of JAXBContext.
Refer this link
Are there any memory utlization issue with JAXB?