1

I'm investigating a heap dump taken by a Hotspot-1.8 JVM. The dump is in hprof format and contains thousands of lambda instances.

They're all created from functions like this:

public class Ref<T> {
  private T obj;

  void set(final T value) {
    obj = value;
    singletonMgr.register(() -> Ref.close(value));
  }

  private static <T> void close(T obj) { /* stuff */ }
}

Works and the lambda shows up in the list singletonMgr manages. But it's empty apart from the <class> reference each object gets. I would have expected a reference to value in there?

What am I missing and how can I evaluate each Lambda's value?

mabi
  • 5,279
  • 2
  • 43
  • 78
  • I just tried it and had no problems seeing the captured value (fields are typically named `arg$1`, etc.). —I used JVisualVM, though. – Holger Aug 28 '18 at 14:26

0 Answers0