[Bf-python] Memory issue with Mathutils

Gilbert, Joseph T. jgilbert at tigr.ORG
Tue Nov 22 16:56:00 CET 2005


It might be a problem with the internal coercion methods having too many
references to an object. This should be submitted as a bug report.

 

________________________________

From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Michael
Schardt
Sent: Tuesday, November 22, 2005 10:50 AM
To: bf-python at projects.blender.org
Subject: [Bf-python] Memory issue with Mathutils

 

Hello all!

 

I wrote an email to Campbell Barton already about this issue - but i
don't know if will take care...

Would you please confirm my "experiment":

 

There seems to be a memory leak in Mathutils: The problem comes up when
multiplicating 

scalar * vector,

scalar * matrix,

vector * scalar,

matrix * scalar,

vector * matrix,

and matrix * vector

 

I tested with latest CVS version from testing builds-forum and 2.40
alpha 2 under XP

Simple and "dirty" test: open taskmanager and watch the memory go up,
up, up, up,... whenever running this py-script

 

###########

import Blender; from Blender import Mathutils

 

v = Mathutils.Vector(1.0, 2.0, 3.0, 4.0)
m = Mathutils.Matrix([1.0, 0.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0, 0.0],
                     [0.0, 0.0, 1.0, 0.0],
                     [0.0, 0.0, 0.0, 1.0])

 

for i in xrange(100000):

  n = 5.0 * v # +6MB

#  n = 5.0 * m # +12MB
#  n = v * 5.0 # +6MB
#  n = m * 5.0 # +12MB
#  n = v * m # +6MB
#  n = m * v # +12MB

###########

 

On my computer memory is never freed again (at some point windows even
starts swapping to disk)

This becomes really a problem when using Mathutils within
spacehandlers...

 

Michael Schardt

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20051122/7177b925/attachment.html>


More information about the Bf-python mailing list