Low memory with 640Kb of live bytes?

前端 未结 1 1804
孤城傲影
孤城傲影 2020-12-16 08:32

i\'ve a problem with my application that need to display a lot of images and video.

After running ObjectAlloc tool, i see that the live bytes is 640Kb and the overal

1条回答
  •  时光说笑
    2020-12-16 09:12

    The ObjectAlloc instrument does not display the full memory usage of your application, particularly if you have a lot of user interface elements that you are dealing with. For a more accurate reading of your application's total memory footprint at any given time, use the Memory Monitor instrument instead. You will see that your application is indeed exceeding the memory threshold on the device.''

    You can add the Memory Monitor instrument by clicking on the Library button of the toolbar in Instruments. A list of all the available instruments appears, and you drag Memory Monitor onto the Instruments area of the main window.

    If you combine the Memory Monitor instrument with the ObjectAlloc one, you should be able to track what is triggering memory spikes within your application. Select the Track inspection head option for the Memory Monitor (below the Instruments list; click on Memory Manager first to activate the tool, the options will appear on the bottom pane) to view the recorded memory size of your application at any point in its execution.

    0 讨论(0)
提交回复
热议问题