0

In my project we are using a small profiling tool for Java. It shows all objects loaded into memory by our application and reflects changes in the objects in real-time. We mostly use it for debugging.

My question is: How can it work? How does an external application know what my app has loaded into memory? Is there some kind of API available for it?

Ordous
  • 3,844
  • 15
  • 25
JavaPassion
  • 112
  • 1
  • 1
  • 7

2 Answers2

3

There are several options available.

  1. Make a heap dump and just analyze that.
  2. Use the Instrumentation API. Note, this is a very advanced topic and most Java developers don't even have a clue about its existence, nor have any practical use for it as is (though the tools made possible are widely used).
Ordous
  • 3,844
  • 15
  • 25
-1

You can use java visualVM to see the objects loaded in to memory.

Shawn
  • 31
  • 7