Skip to content

Commit

Permalink
Removing static lookup of all heap histogram instances.
Browse files Browse the repository at this point in the history
Not needed since we can lookup engines and find the instance per engine.
  • Loading branch information
boris-spas committed Oct 12, 2018
1 parent e9ca067 commit f8f30ac
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ public static HeapHistogram find(Engine engine) {
return HeapHistogramInstrument.getHistogram(engine);
}

public static Set<HeapHistogram> getAllHeapHistogramInstances() {
return HeapHistogramInstrument.getAllHeapHistograms();
}

/**
* Controls whether the tracer is collecting data or not.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
import com.oracle.truffle.api.instrumentation.TruffleInstrument;
import com.oracle.truffle.tools.profiler.CPUTracer;
import com.oracle.truffle.tools.profiler.HeapHistogram;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.graalvm.options.OptionCategory;
import org.graalvm.options.OptionDescriptors;
import org.graalvm.options.OptionKey;
Expand Down Expand Up @@ -62,7 +58,6 @@ public HeapHistogramInstrument() {
static final String VERSION = "0.1.0";
private HeapHistogram histogram;
private static ProfilerToolFactory<HeapHistogram> factory;
private static Map<Env, HeapHistogram> envs = new HashMap<>();

/**
* Sets the factory which instantiates the {@link HeapHistogram}.
Expand Down Expand Up @@ -101,10 +96,6 @@ public static HeapHistogram getHistogram(Engine engine) {
return instrument.lookup(HeapHistogram.class);
}

public static Set<HeapHistogram> getAllHeapHistograms() {
return new HashSet<>(envs.values());
}

/**
* Called to create the Instrument.
*
Expand All @@ -118,7 +109,6 @@ protected void onCreate(TruffleInstrument.Env env) {
histogram.setCollecting(true);
}
env.registerService(histogram);
envs.put(env, histogram);
}

/**
Expand All @@ -139,7 +129,6 @@ protected OptionDescriptors getOptionDescriptors() {
@Override
protected void onDispose(TruffleInstrument.Env env) {
histogram.close();
envs.remove(env);
}

@Option(name = "", help = "Enable the Heap Histogram.", category = OptionCategory.USER)
Expand Down

0 comments on commit f8f30ac

Please sign in to comment.