sio2PhysicInit memory consumption
2 posters
sio2PhysicInit memory consumption
I have just tested my application on an actual device (iPod touch 2G, 8GB) for the first time. It quits with status 101 with means out of memory. So I started digging what might be taking so much and I eventually found out that calling sio2PhysicsInit takes approx. 48 MB of memory of ca. 50 MB available...
Do you have any idea what exactly causes so much memory consumption and how to avoid it?
Best,
Matt
Do you have any idea what exactly causes so much memory consumption and how to avoid it?
Best,
Matt
Re: sio2PhysicInit memory consumption
Hmmmmm make sure that you have the following values set in btDefaultCollisionConfiguration.h
This should init the physic with around 4MB.
Are you using the version of Bullet that comes with the SDK or you integrate your own?
- Code:
struct btDefaultCollisionConstructionInfo
{
btStackAlloc* m_stackAlloc;
btPoolAllocator* m_persistentManifoldPool;
btPoolAllocator* m_collisionAlgorithmPool;
int m_defaultMaxPersistentManifoldPoolSize;
int m_defaultMaxCollisionAlgorithmPoolSize;
int m_defaultStackAllocatorSize;
btDefaultCollisionConstructionInfo()
:m_stackAlloc(0),
m_persistentManifoldPool(0),
m_collisionAlgorithmPool(0),
m_defaultMaxPersistentManifoldPoolSize( 1638 ), //65536
m_defaultMaxCollisionAlgorithmPoolSize( 1638 ), //65536
m_defaultStackAllocatorSize( 131072 ) // 5 * 1024 * 1024
{
}
};
This should init the physic with around 4MB.
Are you using the version of Bullet that comes with the SDK or you integrate your own?
Re: sio2PhysicInit memory consumption
Thanks, that's it! I was using the btDefaultCollisionConfiguration.h from SIO2 V1.2... it's not changed there.
Best,
Matt
NB: I'm so disappointed. I thought the Simulator was simulating the device performance accurately, but the framerate dropped from solid ~30 in the Simulator to ~10 FPS :-(
Best,
Matt
NB: I'm so disappointed. I thought the Simulator was simulating the device performance accurately, but the framerate dropped from solid ~30 in the Simulator to ~10 FPS :-(
Re: sio2PhysicInit memory consumption
Yeah, I know, alot of people think that the simulator is doing the same thing as on the device, but... not really...
Me from what I test, around 100 objects total 5k to 6k or triangles with multitexture + physic + ligthing (4~5 lights) per FOV should give me an FPS around 15 to 30 (which is acceptable)... of course performance may vary depending on what you are doing but... as long as you stick with + or - that you should get good results...
Me when I develop I always run the stuff on the simulator first then when its working Im profiling and testing on the device, so no last minute surprises
Keep your head up dude! Do some optimization and im 100% sure that you'd be able to adjust your stuff to have good performance on the device (shark is your friend, remember that )
Cheers,
Me from what I test, around 100 objects total 5k to 6k or triangles with multitexture + physic + ligthing (4~5 lights) per FOV should give me an FPS around 15 to 30 (which is acceptable)... of course performance may vary depending on what you are doing but... as long as you stick with + or - that you should get good results...
Me when I develop I always run the stuff on the simulator first then when its working Im profiling and testing on the device, so no last minute surprises
Keep your head up dude! Do some optimization and im 100% sure that you'd be able to adjust your stuff to have good performance on the device (shark is your friend, remember that )
Cheers,
Re: sio2PhysicInit memory consumption
By the way, you should upgrade to v1.2.1, alot of optimization have been done, that might help you gain a bit more FPS...
Re: sio2PhysicInit memory consumption
Yeah, I still need to look into these tools. I'm coming from the Windows area and I'm currently happy that I get around with XCode quite well. I already looked into Instruments but I didn't really get it (although I'm familiar with VTune/CodeAnalyst ;-)). Do you have a good resource at hand which explains profiling and finding memory leaks, in particular for C++ apps on the iPhone?sio2interactive wrote:(shark is your friend, remember that )
Best,
Matt
Re: sio2PhysicInit memory consumption
Hummmm honestly I learn them by myself, they are pretty intuitive, doesn't matter from what kind of background you are coming from...
Just give it a shot... what I suggest you to check is:
Leaks, Shark and CPU Sample
thats the one that Im using the most...
Just give it a shot... what I suggest you to check is:
Leaks, Shark and CPU Sample
thats the one that Im using the most...
Re: sio2PhysicInit memory consumption
I have updated to version 1.2.1, unfortunately it didn't change anything regarding the rendering performance. I have some billboards in my scene which I clone to simulate some snow. Unfortunately, this lowers the framerate by 50% --- do you have any hints how I could speed this up a bit? I know that there's some sorting vodoo going on for transparent surfaces, but that unfortunately also leads to some performance-taking texture switches (I added a little counter for material changes and had five times as much changes). I was thinking about rendering them after everything else... what do you think? Could that work? Or do you have any performance tips?
Best,
Matt
Best,
Matt
Re: sio2PhysicInit memory consumption
Dude! Don't use billboard for particles WAY to slow on the device... send me your email address and I'll post you my current dev. version with a particle system demo...
Cheers,
Cheers,
Re: sio2PhysicInit memory consumption
Forget about the email take a look at this link:
http://sio2interactive.com/dump/particle_tutorial.zip
Cheers,
http://sio2interactive.com/dump/particle_tutorial.zip
Cheers,
Re: sio2PhysicInit memory consumption
Thanks alot! I'll check this out tonight.sio2interactive wrote:Forget about the email take a look at this link:
Matt
Re: sio2PhysicInit memory consumption
There's a particle.tga missing, but besides that --- holy crap, it looks great! I'm just upgrading the project, I'll then try to add particle support to my app.
Best,
Matt
Best,
Matt
Re: sio2PhysicInit memory consumption
Hehe glad to hear that, however, particles on the device is like "handle with care" too... cuz that adds alot of "triangles" well points but its basically quads you know that are billboarded in hardware...
Keep that in mind,
Cheers,
Keep that in mind,
Cheers,
Similar topics
» leak of memory
» Any significant changes to memory handling in 1.3.3?
» Memory problem in version 1.3.1?
» sio2Free will make the memory leak????
» Particles System with a little memory leak...
» Any significant changes to memory handling in 1.3.3?
» Memory problem in version 1.3.1?
» sio2Free will make the memory leak????
» Particles System with a little memory leak...
Permissions in this forum:
You cannot reply to topics in this forum