Package com.foursquare.heapaudit.tutorials.example2

Source Code of com.foursquare.heapaudit.tutorials.example2.Static

package com.foursquare.heapaudit.tutorials.example2;

import com.foursquare.heapaudit.HeapQuantile;
import com.foursquare.heapaudit.HeapRecorder;
import com.foursquare.heapaudit.tutorials.Example;

// The following illustrates using HeapAudit to record allocations by static
// instrumentation. See https://github.com/foursquare/heapaudit/blob/master/src/test/java/com/foursquare/heapaudit/tutorials/example2/README.md
// for more information.

public class Static extends Example {

    public static void main(String[] args) {

        allocateFoo();

        HeapQuantile recorder = new HeapQuantile();
        HeapRecorder.register(recorder, HeapRecorder.Threading.Local);

        allocateBar();

        HeapRecorder.unregister(recorder, HeapRecorder.Threading.Local);
        System.out.println(recorder.summarize(HeapRecorder.Threading.Local));

    }

}
TOP

Related Classes of com.foursquare.heapaudit.tutorials.example2.Static

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.