Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Checking JVM memories – heap-size and all


In this recipe, we will learn how to get the JVM memory information with regard to heap-size, non heap-size, metaspace size (PermGen until Java 7), eden, old, and survivor, by invoking a command to the CLI. There is a command for each of them.

Getting ready

Remember I'm running WildFly remotely, bound to 192.168.59.103 as IP. WildFly is already up and running.

How to do it…

We will walk through the "heap", "non-heap", "metaspace" (PermGen until Java 7), "eden", "old", and the "survivor" area memories, separately.

Heap

For information on heap memory, perform the following steps:

  1. Open a new terminal window and do as follows:

    $ cd $WILDFLY_HOME
    $ ./bin/jboss-cli.sh -c --controller=192.168.59.103:9990 --user=wildfly --password=cookbook.2015 --command="/core-service=platform-mbean/type=memory:read-attribute(name=heap-memory-usage,include-defaults=true)"
    {
        "outcome" => "success",
        "result" => {
            "init" => 67108864L,
            "used" =&gt...