2

This is what I see in Jprofiler's memory view when I profile my application. What is the significance of

[2 classes] .

I am expecting this class to be a singleton and have only one instance. Am I understanding anything differently?

com.xxx.yyy.dao.impl.MyDAOImpl$$FastClassByCGLIB$$7574275c {[2 classes] 4 instances
hop
  • 2,518
  • 11
  • 40
  • 56

1 Answers1

1

May be you are working in an environement with different class loaders. In this case, each time some class loaded by a "new" class loader asks for the singleton, a new class instance is created and a new singleton object instance. Nevertheless if the profiler says 4 instances for 2 classes instances it means that you don't have a singleton but a 2-singleton.

Manuel Selva
  • 18,554
  • 22
  • 89
  • 134