[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 526
  • Last Modified:

Free Memory

Hi Guys,

We're using JMeter to load test our web based Java application, deployed in Linux server, web server : apache tomcat.

We run it for 25 concurrent users. And the memory spike into 2GB.

Then we stop the test on JMeter, but the memory is still on 2Gb,

Can u suggest solution so the memory is getting back to less than 2Gb? Or we just need to to wait?
0
softbless
Asked:
softbless
4 Solutions
 
objectsCommented:
As I mentioned in your other question it won't.
What you're looking at is the memory allocated to the application by the OS
It will be given more when needed but it won't be released.

Its also not directly related to the amount of memory actually used by your application.
0
 
Abhishek_ChibCommented:
Memory will not clear easily because of Java Garbage and Cache :

Try to concentrate on three Java Application Values :

ConcMarkSweepGC
CMSClassUnloadingEnabled
CMSPermGenSweepingEnabled

And :( that is kind of fix )

asynchronous calls to be processed synchronously, instead of many asynchronous calls waiting for some lock to be released on a synchronous

For Above two matter you need to talk with your Dev Team also.
0
 
objectsCommented:
What you want to do is make Xms the same as Xmx. that'll stop it adding more memory when required which is only going to use up resources.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
objectsCommented:
But your main problem is that you're not measuring the memory *usage* of the *application*.
you're measuring the memory *allocated* to the *vm*
0
 
msk_apkCommented:
trying invoking System.gc() through any of your APIs after stopping JMeter.
0
 
dpearsonCommented:
It may help you to read up on the docs for how Java describes its own memory.

From code you can do this to examine the current memory usage:

            MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
            MemoryUsage usage = mbean.getHeapMemoryUsage() ;
            double committed = usage.getCommitted() ;
            double init = usage.getInit() ;
            double used = usage.getUsed() ;
            double free = committed - used ;
            double max = usage.getMax() ;

The docs for what those specific values mean are explained here:
http://download.oracle.com/javase/1.5.0/docs/api/java/lang/management/MemoryUsage.html

I think you're currently confusing "Committed" with "Used".

Doug
0
 
softblessAuthor Commented:
thanks
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now