Corona® Profiler- A Line-by-Line Analysis of Your Code - New Update

Hello Mo,

Yeah the page refreshes itself as new results become available. Perhaps you can hit ctrl-a and ctrl-c in quick succession to copy the entire page. Glad you are liking profiler and Glider!

Regards,
M.Y. Developers
[import]uid: 55057 topic_id: 17975 reply_id: 126939[/import]

Thanks! I will try that and report here.

Mo. [import]uid: 100814 topic_id: 17975 reply_id: 126973[/import]

@M.Y Developers

THANKS! ctrl-a and ctrl-c worked! Here what I got using Revmob.lua (ad network) and switch between menu.lua and another lua module and back. Would you think this is means there is a a leak? I am worry about the constant addition of 12 (is this means 12 bytes? or 12 Kbytes?)

Sorry for the formatting. I could only convert the result into a text and lost most of the formatting from the web page.

Thanks.

Mo

-------------------------diff snapshot “2”--------------------------
size increase var name defined in

43 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua

31 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

5 facebook global
4 t end}end)package.preload[‘advertiser’]=(function(…)local e=require(‘json’) require(‘revmob_messages’)require(‘revmob_client’)require(‘revmob_utils’) require(‘loadsave’)Advertiser={registerInstall=function(n,e)local t=function(t) if(t.statusCode==200)then in revmob.lua

1 lineNum global

1 filename global

1 networkListener global

-10 e end,install=function(e,n)Client.post(e:urlInstall(),e:payloadAsJsonString(),n) end,startSession=function(e)Client.post(e:urlSession (),e:payloadAsJsonString(),listener)end,theFetchSucceed=function(l,i,t) local e=i.status or i.statusCode in revmob.lua

-------------------------diff snapshot “3”--------------------------
size increase var name defined in

12 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua

12 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

-------------------------diff snapshot “4”--------------------------
size increase var name defined in

12 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua

12 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

-------------------------diff snapshot “5”--------------------------

size increase var name defined in

12 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua
12 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

[import]uid: 100814 topic_id: 17975 reply_id: 127345[/import]

@M.Y Devellopers

I am curious. Is the memory increase is in bytes or Kbytes?

Thanks!

Mo

EDIT: I also have a question about #Display Objects Is there anyway to tell which display is adding 1 to the memory (memory increase during a diff)? It seems to be a global but I cannot figure out what is adding a display object every time I play a game and come back to the menu.lua I am also not sure how much 1 memory increase means in bytes (related to my question above) Thanks! [import]uid: 100814 topic_id: 17975 reply_id: 127350[/import]

@M.Y Developers

THANKS! ctrl-a and ctrl-c worked! Here what I got using Revmob.lua (ad network) and switch between menu.lua and another lua module and back. Would you think this is means there is a a leak? I am worry about the constant addition of 12 (is this means 12 bytes? or 12 Kbytes?)

Sorry for the formatting. I could only convert the result into a text and lost most of the formatting from the web page.

Thanks.

Mo

-------------------------diff snapshot “2”--------------------------
size increase var name defined in

43 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua

31 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

5 facebook global
4 t end}end)package.preload[‘advertiser’]=(function(…)local e=require(‘json’) require(‘revmob_messages’)require(‘revmob_client’)require(‘revmob_utils’) require(‘loadsave’)Advertiser={registerInstall=function(n,e)local t=function(t) if(t.statusCode==200)then in revmob.lua

1 lineNum global

1 filename global

1 networkListener global

-10 e end,install=function(e,n)Client.post(e:urlInstall(),e:payloadAsJsonString(),n) end,startSession=function(e)Client.post(e:urlSession (),e:payloadAsJsonString(),listener)end,theFetchSucceed=function(l,i,t) local e=i.status or i.statusCode in revmob.lua

-------------------------diff snapshot “3”--------------------------
size increase var name defined in

12 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua

12 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

-------------------------diff snapshot “4”--------------------------
size increase var name defined in

12 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua

12 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

-------------------------diff snapshot “5”--------------------------

size increase var name defined in

12 t end)package.preload[‘dispatch’]=(function(…)local t=_G in revmob.lua
12 t end)package.preload[‘asyncHttp’]=(function(…)local e=require"socket"local n=require"dispatch"local u=require"socket.http"local o=require"ltn12"n.TIMEOUT=10 in revmob.lua

[import]uid: 100814 topic_id: 17975 reply_id: 127345[/import]

@Mo,

“Is the memory increase is in bytes or Kbytes?”
The memory increase is in the number of unique keys in the table. It is not possible in lua to find out the size of a table. It would be nice if there was a sizeof() function like C but there isn’t. However, if you have a leak you have to have a growing table at “steady state” somewhere.

#Display Objects Is there anyway to tell which display is adding”
Unfortunately no. This one is rather tricky because there is no way to find out which line of code a particular display object came from. This is a hard problem in general to tackle and it requires very tight control of where display objects come from. I bet you have hidden display objects somewhere that never get removed. Perhaps you can go through all display objects and set visibility to true? You may find display objects that you didn’t know where there and based on what they are you can deduce where in your code they came from.

In summary a 1 object increase does not tell you how much memory that object is taking up. It is probably not possible to determine how much memory a display object is taking up from Lua alone.

Regards,
M.Y. Developers [import]uid: 55057 topic_id: 17975 reply_id: 127494[/import]

Thanks a lot. I appreciate the time and responses. I will try the suggestion of making all displays visible and see. I am sure you are right since they are tons of display objects on the main gameScreen.lua

Thanks again.

Mo [import]uid: 100814 topic_id: 17975 reply_id: 127541[/import]

@M.Y Devellopers

I am curious. Is the memory increase is in bytes or Kbytes?

Thanks!

Mo

EDIT: I also have a question about #Display Objects Is there anyway to tell which display is adding 1 to the memory (memory increase during a diff)? It seems to be a global but I cannot figure out what is adding a display object every time I play a game and come back to the menu.lua I am also not sure how much 1 memory increase means in bytes (related to my question above) Thanks! [import]uid: 100814 topic_id: 17975 reply_id: 127350[/import]

@Mo,

“Is the memory increase is in bytes or Kbytes?”
The memory increase is in the number of unique keys in the table. It is not possible in lua to find out the size of a table. It would be nice if there was a sizeof() function like C but there isn’t. However, if you have a leak you have to have a growing table at “steady state” somewhere.

#Display Objects Is there anyway to tell which display is adding”
Unfortunately no. This one is rather tricky because there is no way to find out which line of code a particular display object came from. This is a hard problem in general to tackle and it requires very tight control of where display objects come from. I bet you have hidden display objects somewhere that never get removed. Perhaps you can go through all display objects and set visibility to true? You may find display objects that you didn’t know where there and based on what they are you can deduce where in your code they came from.

In summary a 1 object increase does not tell you how much memory that object is taking up. It is probably not possible to determine how much memory a display object is taking up from Lua alone.

Regards,
M.Y. Developers [import]uid: 55057 topic_id: 17975 reply_id: 127494[/import]

Thanks a lot. I appreciate the time and responses. I will try the suggestion of making all displays visible and see. I am sure you are right since they are tons of display objects on the main gameScreen.lua

Thanks again.

Mo [import]uid: 100814 topic_id: 17975 reply_id: 127541[/import]

Pinpointing memory leak / crash. Can the Corona Profiler help me pinpoint where and how to resolve a memory leak / crash? It seems to be happening at the exact spot on my iPad, but I cannot find the line of code or function that is causing it. If I am not disposing audio or display objects, can Corona Profiler help me find the problem and suggest a solution?

Thanks. [import]uid: 8780 topic_id: 17975 reply_id: 139836[/import]

Pinpointing memory leak / crash. Can the Corona Profiler help me pinpoint where and how to resolve a memory leak / crash? It seems to be happening at the exact spot on my iPad, but I cannot find the line of code or function that is causing it. If I am not disposing audio or display objects, can Corona Profiler help me find the problem and suggest a solution?

Thanks. [import]uid: 8780 topic_id: 17975 reply_id: 139836[/import]