0

在尝试监控对象大小时,字符串对象不会显示在分析结果中。谁能告诉我 wat 是使它们显示在结果中的程序....

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 保留大小 Shallow Size [Unreachable] 称为 40 40 [Unreachable] 称为 40 40

4

1 回答 1

0

也许,您的对象已被收集或计划收集(无法访问)。您在哪一点捕获内存快照?

免责声明:我是 YourKit 开发人员。

于 2013-04-02T12:56:02.797 回答