I dont know where to ask this,
but since you are the developer of corona profiler,
I am just going to ask the question here (I don’t see much traffic in your website’s forum, some threads even have some spams in them).
I am new to corona, I have problem reading the memory test results that I get by running the profiler.
Any more details information on how to read and solve the memory problem in my code?
and another thing, how to get the memorytimeline in the glider to work?
Every time I run the memorytimeline it’s always empty.
Thanks for your question. Here is the general algorithm for detecting memory leaks
First find out if you truly do have a memory leak.
include this code snippet in your main
local monitorMem = function()
collectgarbage()
print( "MemUsage: " .. collectgarbage("count") )
local textMem = system.getInfo( "textureMemoryUsed" ) / 1000000
print( "TexMem: " .. textMem )
end
Runtime:addEventListener( "enterFrame", monitorMem )
The best way to tell if you have a memory leak is to repetitively do a task that be undo-able. For example, going from your main menu to a game level and back to the main menu should be undo-able. Next do the transition multiple times and check the memory during each transition, if it is increasing at a constant rate every time then you have a leak.
If you do have a leak we suggest you use our Profiler with mode 4 and repeat the steps above that gave you the leak. The results will tell you which table is increasing (and therefore leaking.)
I tried using mode 4, but I can’t find any result html page in the sandbox folder (using on mac) [import]uid: 31508 topic_id: 32206 reply_id: 128348[/import]
Thanks for your question. Here is the general algorithm for detecting memory leaks
First find out if you truly do have a memory leak.
include this code snippet in your main
local monitorMem = function()
collectgarbage()
print( "MemUsage: " .. collectgarbage("count") )
local textMem = system.getInfo( "textureMemoryUsed" ) / 1000000
print( "TexMem: " .. textMem )
end
Runtime:addEventListener( "enterFrame", monitorMem )
The best way to tell if you have a memory leak is to repetitively do a task that be undo-able. For example, going from your main menu to a game level and back to the main menu should be undo-able. Next do the transition multiple times and check the memory during each transition, if it is increasing at a constant rate every time then you have a leak.
If you do have a leak we suggest you use our Profiler with mode 4 and repeat the steps above that gave you the leak. The results will tell you which table is increasing (and therefore leaking.)
I tried using mode 4, but I can’t find any result html page in the sandbox folder (using on mac) [import]uid: 31508 topic_id: 32206 reply_id: 128348[/import]
“Yes mode 1, 2, 3 have the result page.”
Mode 4 should write a page called snapshot.html. Please check to see if it exists in the same place as the URL shown by modes 1,2, or 3.
No problem. Please refer to the documentation for more information. Ideally you want to put a snapshot point at a place in your code that satisfies a few criteria:
it is called repetitively
each time it is called you expect the memory footprint to be the same (no leaks)
your main menu for instance is a good place to place the snapshots.
“Yes mode 1, 2, 3 have the result page.”
Mode 4 should write a page called snapshot.html. Please check to see if it exists in the same place as the URL shown by modes 1,2, or 3.
No problem. Please refer to the documentation for more information. Ideally you want to put a snapshot point at a place in your code that satisfies a few criteria:
it is called repetitively
each time it is called you expect the memory footprint to be the same (no leaks)
your main menu for instance is a good place to place the snapshots.