How to reduce RamUsage?

About advanced scenes, and the Thyme scripting language used in Algodoo.

How to reduce RamUsage?

Postby dobili » Tue Sep 15, 2015 3:53 pm

Hi,

I have some problems with the performance while running one of my scene, you can download it here:

https://drive.google.com/file/d/0B0GZ31WBLW4WeXE1aXg4SElMc2c/view?usp=sharing

Algodoo uses between 500 and 900mb of my ram while running the scene. Well, there are a lot of calculation running in the background over and over again, but this should stress the cpu not the ram, shouldn't it? And of course there are nearly 30-50 local variables which are set everytime when certain objects update themself but this should be nothing compared to the tons of variable other programs or eben windows are setting in every second without my ramspace going crazy.

Could you please check if you have the same problems with my scene? And if this is the case, any Ideas how to get better performances? Maybe I should use more globale variable instead of setting them everytime when an object updates?
dobili
 
Posts: 9
Joined: Tue May 26, 2015 10:52 pm

Re: How to reduce RamUsage?

Postby homieeee » Tue Sep 15, 2015 6:26 pm

Algodoo has poor garbage collection. Every time you delete an object it stays in ram so it is always needing more ram. This also happens when undoing. The only way to get around the large ram usage is to either buy more ram or restart your algodoo often since restarting is the only way to dump all data from ram. All scenes have this problem all you can do is use less objects. I can not access your google drive file for some reason if you fix it i can take a look into optimization.
User avatar
homieeee
 
Posts: 14
Joined: Thu Oct 09, 2014 2:13 am

Re: How to reduce RamUsage?

Postby homieeee » Tue Sep 15, 2015 10:37 pm

Alright after looking at your scene you HAVE to change everything to a texture. Seriously you have over 3000 objects on layer 2 when you should only have 1 a box with that texture. Code wise there are a lot of things there they could be condensed down but it looks like you are too far deep to change that. All in all the game lags because you have over 3000 objects. You should not have more than 100 on a scene like this.
User avatar
homieeee
 
Posts: 14
Joined: Thu Oct 09, 2014 2:13 am

Re: How to reduce RamUsage?

Postby dobili » Wed Sep 16, 2015 12:14 pm

3000?!!!! I can't believe that. There must have been some failures in Algodoo while creating the objects. Even the bride.... well, maybe its true.^^

I heard about the possibility to insert images and textures in Algodoo. For example it would be very nice to have just one large rectangle with the texture of the bridge instead of hundrets small objects forming the bridge. Is it possible to make a screenshot of the bridge and insert the screenshot as texture afterwards?
dobili
 
Posts: 9
Joined: Tue May 26, 2015 10:52 pm

Re: How to reduce RamUsage?

Postby homieeee » Thu Sep 17, 2015 12:26 am

If you are using a PC open the scene and remove any object you do not want in the texture. (if you are not on a pc google screen capture for ... )
Press the windows key and search for "Snipping tool".
Press new and highlight area of scene.
Save to desktop.
Create new box in algodoo the same size as picture. (does not have to be perfect)
Select appearance on new box.
Click "Find texture".
Click the little folder by "/algodoo/textures/".
Click your name on the left most menu .
Click desktop in the list.
Click choose.
Select picture from menu.

Hopefully that makes sense if you get confused just ask ill try to help.
User avatar
homieeee
 
Posts: 14
Joined: Thu Oct 09, 2014 2:13 am

Re: How to reduce RamUsage?

Postby dobili » Thu Sep 17, 2015 4:24 pm

Hi,

Thank you very much for your help. After some work I have managed to replace a lot of objects with textures and now it runs a lot more smoother! The main work was to recode the menu and to find a way to automaticly scale the textures properly. :P

Here it is: https://drive.google.com/file/d/0B0GZ31WBLW4WU2VuQkgtWnpVaEk/view?usp=sharing
dobili
 
Posts: 9
Joined: Tue May 26, 2015 10:52 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests