@y.sravankumar - Try switching the call to physics.stop(), to physics.pause() and see if that clears up your issue. Pausing physics is probably what you want, unless you are quitting the game. I have read that the only safe place to call physics.stop() is in OnApplicationExit.
@mike4
yes, it’ll solve this problem but introduces another problem.
in my case I’ve to place concrete block kind of structure to physics. if I place concrete blocks (with dimensions of 60) as stack at say x=10
and in next level if placed concrete blocks at say x=30. then some how concrete blocks are jumping as if they are colliding with previously placed blocks.
if I stop physics and start when levels is loaded, then this problem is not observed.
I prepared sample code, which exactly replicates the problem. I can post here if you want to take a look [import]uid: 97420 topic_id: 17975 reply_id: 86104[/import]
@y.sravankumar - Make sure you remove all the objects that are using physics in the first level, before you build the next level.
Ideally, you would remove all the display objects using physics, then pause physics, then in the next level add the new physics objects. You could also use timer.performWithDelay() to wait a tick or two, and then call the garbage collector to make sure everything is cleaned up, and then pause physics.
Sounds like you are pausing and removing and creating a little to quickly, so some things may be hanging around and not properly collected. [import]uid: 5317 topic_id: 17975 reply_id: 86117[/import]
@mike4,
in my game there is considerable delay in loading next level.
and I called GC, but no difference
I’ve placed sample code, please have a look at it.
Can you please tell us why you are pausing the physics engine? In our apps we just remove all physics bodies form the scene but we never had to pause or stop the physics engine to transition from scene to scene. Perhaps after removing the objects you may need to wait a few frames for the physics engine to properly remove the objects? We will take a look at your code, thanks for sharing!
I’m involved in developing “Link” game (you can fine free version in Apple market). if I don’t pause or stop, constructed bridge is going out of order when added to physics (user starts simulation to test constructed bridge).
In this game user can start and stop simulation at any time
I tried to use diffsnapshot to track a mem leak I have in my app (when switching scene using director and textcandy)
It seems the biggest difference is :
size increase var name defined in
10677 tableDict global
Unfortunately, I have no idea what tableDict means … [import]uid: 9328 topic_id: 17975 reply_id: 86313[/import]
Is the tableDict global growing by that much consistently? Can you perhaps send us some code we can look at? We do not use globals in profiler.lua so it is not coming from there.
It might be a part of Lua’s internals? Check out this thread:
The “Edit” means that my mem leaks comes from a bug that is corrected in duild 2012.744 ? (that would be cool)
As for yout very kind proposition at looking at my code, I 'll try first to narrow the issue and make the smallest sample code as possible :)) [import]uid: 9328 topic_id: 17975 reply_id: 86441[/import]
I tried to narrow my code and realized that the tabledict and mem leak are close to 0 when avoiding TextCandy effects.
I must do something wrong with this (great) lib. I follow this point on xpressive forum section.
Thx anyway for your support ( I would send my code if I fall on something I really can’t figure out [import]uid: 9328 topic_id: 17975 reply_id: 86445[/import]
Did you solve your problem? We are curious to know if you found something. It is unlikely a library like TextCandy will have memory leaks but perhaps tabledict tells us something else. It would help us all if you posted your results here.
I had no answer in the other post, and haven’t tried the build 744 yet. I’m working on cleaning my code and screen transitions.
Anyway, thx for your interest :)) [import]uid: 9328 topic_id: 17975 reply_id: 87946[/import]
It’s working great, I just have one question.
What are people referring to when they’re saying things like
“Your Corona profiler helps me to improve the performance of my game dramatically!!! I started from using 22 sec from 25 on PC) and now it 0,8-1,5 sec from 25.”
I’ve seen others making similar statements but I can’t quite understand what it means. [import]uid: 129450 topic_id: 17975 reply_id: 93297[/import]
Thank you for trying it out!
I started from using 22 sec from 25 on PC, and now it 0,8-1,5 sec from 25.
PC probably means Particle Candy library. 22-25 seconds means that initially the particle candy code was using 22-25 seconds of profile time. After some optimization guided by specific functions reported by profiler, he was able to get the usage time down to 8 seconds, a 3 fold increase in performance.
The point is that profiler can tell you exactly what functions are slowing down your code and you can modify them and see if your modifications actually made a difference, and you can quantify how much.