0

on trying to monitor object sizes, string objects are not shown in the profiled results. Can anyone tell me wat is the procedure to make them shown in results....

public class calling extends called {
called myobj3 = new called();
called myobj4 = new called();
    public void function() {
    myobj3.d="Plz";
    myobj3.e="Help";
    myobj4.d="Thank";
    myobj4.e="You";   
    myobj3.act();
    myobj4.act();
    }
 public static void main(String [] args) { 
    System.out.println("calls an object from called.java");
    calling obj = new calling();
    obj.function();
 }
 }
class called {
public String d;
public String e;  
public void act() {
System.out.println(d+e);
}
}

memory profile Retained size Shallow Size [Unreachable] called 40 40 [Unreachable] called 40 40

Dhinesh
  • 1
  • 1

1 Answers1

0

Perhaps, your objects have been collected or scheduled for collection (unreachable). In which point do you capture memory snapshot?

Disclaimer: I'm a YourKit developer.