4 Replies Latest reply on Feb 15, 2013 5:33 AM by nickarls

    Check Memory usage in JBoss AS 7.1

    soumyadas1206

      Is there any way to check the memory usage in JBoss AS 7.1? I want to check the memory leak in the application server. How can I check?

        • 2. Re: Check Memory usage in JBoss AS 7.1
          wdfink

          Also jstat is a tool provided by the standard java installation to use via command line with a small footprint, so I've used it in production.

           

          http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstat.html

          • 3. Re: Check Memory usage in JBoss AS 7.1
            brian.stansberry

            The AS also exposes the standard platform mbean data via the CLI:

             

             

            [standalone@localhost:9999 /] /core-service=platform-mbean/type=
            class-loading      compilation        garbage-collector  memory             memory-manager     memory-pool        operating-system   runtime            threading          
            [standalone@localhost:9999 /] /core-service=platform-mbean/type=memory-pool/name=
            CMS_Old_Gen         CMS_Perm_Gen        Code_Cache          Par_Eden_Space      Par_Survivor_Space  
            [standalone@localhost:9999 /] /core-service=platform-mbean/type=memory-pool/name=Par_Eden_Space:read-resource
            {
                "outcome" => "success",
                "result" => {
                    "name" => "Par_Eden_Space",
                    "type" => "HEAP",
                    "valid" => true,
                    "memory-manager-names" => [
                        "ConcurrentMarkSweep",
                        "ParNew"
                    ],
                    "usage-threshold-supported" => false,
                    "collection-usage-threshold-supported" => true,
                    "usage-threshold" => undefined,
                    "collection-usage-threshold" => 0L,
                    "usage" => {
                        "init" => 13500416L,
                        "used" => 6431648L,
                        "committed" => 13500416L,
                        "max" => 26869760L
                    },
                    "peak-usage" => {
                        "init" => 13500416L,
                        "used" => 13500416L,
                        "committed" => 13500416L,
                        "max" => 26869760L
                    },
                    "usage-threshold-exceeded" => undefined,
                    "usage-threshold-count" => undefined,
                    "collection-usage-threshold-exceeded" => true,
                    "collection-usage-threshold-count" => 0L,
                    "collection-usage" => {
                        "init" => 13500416L,
                        "used" => 0L,
                        "committed" => 13500416L,
                        "max" => 26869760L
                    }
                }
            }
            
            • 4. Re: Check Memory usage in JBoss AS 7.1
              nickarls

              As a side note (recalling from other thread), was it the case that there is currently no CLI way of reading a specific value from a returned array? E.g the "peak-usage", "max" value? Outputted like that the peak-usage looks like sort of a map.