script from shell cause out_of_memory

MakeHuman python API, python plugins, etc

Moderator: joepal

script from shell cause out_of_memory

Postby picci » Wed Jan 08, 2014 5:01 pm

Hello,
I wrote a little python script that works from shell.
It basically load a model from a .mhm file print on a file the measures of the subject!!
It iterate of many files ~ 10000.
After 5500 iterations the script crash for out-of-memory!!
What could be the problem??


inside the loop:

human.load(path)
f.write(str(human.getGender()))
f.write('\t')
f.write(str(human.getAgeYears()))
..
..
..


I'm not very familiar with OOP in Python: I have to destroy the human object at each iteration??


thank you
Marco
Marco
picci
 
Posts: 21
Joined: Thu Jun 06, 2013 2:10 pm
Location: USA

Re: script from shell cause out_of_memory

Postby duststorm » Wed Jan 08, 2014 7:32 pm

I'm not sure. It might be leaking memory (leaving no longer needed objects in memory) somewhere. But without profiling it's hard to determine this.
I guess MH has never been used or tested to perform so many subsequent operations.

Are you performing long chains of actions (that can be undo-ed)? I know there is no limitation on the amount of actions (which perhaps we should limit, but I have no idea what maximum to use).
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: script from shell cause out_of_memory

Postby picci » Wed Jan 08, 2014 7:49 pm

HI

duststorm wrote:I'm not sure. It might be leaking memory (leaving no longer needed objects in memory) somewhere. But without profiling it's hard to determine this.
I guess MH has never been used or tested to perform so many subsequent operations.


Are you performing long chains of actions (that can be undo-ed)? I know there is no limitation on the amount of actions (which perhaps we should limit, but I have no idea what maximum to use).


I'm just print some values like Age, gender, Height, weight, muscle, and other measuremernts
picci
 
Posts: 21
Joined: Thu Jun 06, 2013 2:10 pm
Location: USA

Re: script from shell cause out_of_memory

Postby duststorm » Wed Jan 08, 2014 8:03 pm

picci wrote:I'm just print some values like Age, gender, Height, weight, muscle, and other measuremernts

I bet it's a little more than that. You will probably modify the human, and print values again. It's possible that every modification adds another action to the stack. You can verify this by looking if the Undo/Redo buttons become active (colored), and how many times you can click undo.

For example, every time you execute human.setAge() you add another action on the stack. Do this a little too many times, and you can fill up your memory with actions.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium


Return to Python scripts

Who is online

Users browsing this forum: No registered users and 1 guest