Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个大对象图。它从一个根对象开始,其属性是由其他对象组成的数组,依此类推。
我想知道这张图到底吃了多少内存。Xcode 是否有任何工具可以按根对象向我显示此信息(可能类似于我所有对象的树)?
或者也许可以在运行时以编程方式计算其大小?
通过运行您的项目来尝试 Instruments Run -> Run with Performance Tool -> Object Allocation。
Run -> Run with Performance Tool -> Object Allocation