WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-03-2009, 02:49 AM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
Exclamation massive memory problems

We use nothing but python and vizard but run into serious memory issues.

what we do is basically creating some (10k-20k primitives) objects every trial...do something. get the participants reponse and then .remove() the corresponding objects.

it turns out vizard (winviz) is eating lots and lots of memory. there has to be some leak, we are pretty sure that we dont hold any references to the objects after a trial.

we tried viz.clearcache()...that helps a little but not really.

some observations from the task manager: (calling viz.clearcache() after each trial)
vizard eats memory up to the point where the process tab shows about 1gig. the system performance tab shows about 3gb of usage (after about 20 trials or so). the computer then starts to heavily page. ..then the usage in the process tab shrinks to like 20mb again (winviz being still the biggest memory user). however in the system performance tab, the memory seems to be still taken. the computer keeps paging a lot. performance while loading new objects is horribly slow.

while pressing F4 to see the render characteristics, everything seems fine. primitive / drawables are reasonable for each trial.
Reply With Quote
  #2  
Old 11-03-2009, 09:00 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
A few questions to help debug:
  • Are you loading objects from file and if so, what format are they?
  • Are you using any media objects (audio,video)?
  • Are you using any plugins or connecting to any hardware?
  • Are you using physics?
  • If you watch task manager while your script is idling (not adding objects), does the memory steadily increase?
If possible, can you send me your script. You can email it directly to me at lashkari@worldviz.com. If the script is too large to send over email, you can use our file upload form.
Reply With Quote
  #3  
Old 11-03-2009, 10:58 AM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
  • wrl
  • no
  • no
  • no
  • its not increasing then as far as i can see

i have sent you an email with the problematic scripts.

thanks in advance
Reply With Quote
  #4  
Old 11-03-2009, 11:47 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I did not receive the email. Can you try sending it again or using the upload form?
Reply With Quote
  #5  
Old 11-03-2009, 08:14 PM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
mhm. the bounce message arrived here in the middle of the night so i missed it until now. sorry. i have resent it via the upload form
Reply With Quote
  #6  
Old 11-04-2009, 06:09 AM
Moh200jo Moh200jo is offline
Member
 
Join Date: Feb 2009
Posts: 99
Unfortunately, I have the same problem as well, my CPU Usage was 100% when I compile my code.
Reply With Quote
  #7  
Old 11-04-2009, 07:53 AM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
Moh200jo: uhm. no. you must've misread this entire thread. it's about memory usage and massive paging. -- that got nothing to do with cpu bottlenecks, at all
Reply With Quote
  #8  
Old 11-04-2009, 08:36 AM
Moh200jo Moh200jo is offline
Member
 
Join Date: Feb 2009
Posts: 99
I am also talking here about the performance of Vizard when I run my code. When I press f4 everything looks good. But the VR scenario is really very slow (i.e. images jump during the scenario uploading )
Reply With Quote
  #9  
Old 11-04-2009, 09:21 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Quote:
Originally Posted by andguent View Post
mhm. the bounce message arrived here in the middle of the night so i missed it until now. sorry. i have resent it via the upload form
Thanks, I got the files.

I ran your script and noticed increasing memory usage as well. I believe the problem is that the script is adding textures but never deleting them. It looks like you are adding a new texture for each model that is loaded, so the number of textures will quickly build up. Your script is already removing the node objects, so you just need to modify it to remove the texture objects as well. This should drastically reduce the memory usage of your script.
Reply With Quote
  #10  
Old 11-04-2009, 10:04 AM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
so vizard is not deleting the textures?
i mean...there is no object where the texture is applied, nor is there any python reference to it.

i couldnt possibly use the texture again?
what am i missing?

-- i'll check tomorrow if that solves the problems.
Reply With Quote
  #11  
Old 11-04-2009, 10:16 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If your script does not require a handle to the texture after applying it to the model, then you can immediately remove it after using it. Example:
Code:
tex = viz.addTexture(...)
model.texture(tex)
tex.remove()
I just added a texture.remove() call to the 4 places in your script where you add a texture and the memory is properly released now.
Reply With Quote
  #12  
Old 11-04-2009, 11:44 AM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
if it is that problem fine. i'll have to check tomorrow again at the office workstation.

just wondering why. i mean why is that something that can "leak". i mean in vizard you use python for all your scripting. i always thought that was one of the advantages of python (or higher level scripting languages for that matter) that you dont have to care about memory management.
Reply With Quote
  #13  
Old 11-05-2009, 01:37 AM
andguent andguent is offline
Member
 
Join Date: Mar 2009
Posts: 8
thanks. that fixed it -- on the same note, where in the manual should i have read about that caveat?

btw, a much better option i found to get ridd of this and at the same time get a better performance is: useCache=True in the .addTexture call. (not doing the remove() nor the viz.clearcache() of course)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vizard memory error durf Vizard 2 08-05-2009 07:28 AM
Problems loading WRL file DrunkenBrit Vizard 2 01-29-2009 12:58 AM
Linking problems with Live Character Frank Verberne Vizard 5 06-04-2008 11:42 AM
2 problems with our HMD Vbents Precision Position Tracker (PPT) 1 07-26-2006 07:55 PM
Problems with lighting in 2.0 murm Vizard 6 04-21-2004 09:59 AM


All times are GMT -7. The time now is 11:10 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC