Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 14, 2019 1:08 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: memory leak!
PostPosted: Mon Apr 10, 2006 2:14 pm 
Offline

Joined: Mon Jan 23, 2006 4:57 pm
Posts: 65
I found what seems to be a memory leak. The code is below. I was wondering what I'm doing wrong or did I find an actual problem. msg_picture is defined as a picture and is a property of the form. msg_obj3d is defined as a object3d and is a property of the form.

dim tmp_data as string
dim d as date

d = new date


'tmp_data = ""
tmp_data = "this is a test=" + d.LongDate + " " +d.LongTime
Rb3DSpace1.objects.Remove(0)
msg_picture = NewPicture(392,309,32)
msg_picture.graphics.foreColor = RGB(255,255,0)
msg_picture.Graphics.TextSize = 12
msg_picture.Graphics.TextFont = "arial"
msg_picture.graphics.DrawString trim(tmp_data), 80, 100, 250
'p.graphics.DrawOval 0,0,p.width-1, p.height-1
msg_obj3d = New Object3D
msg_obj3d.AddShapePicture msg_picture,.005
'obj.position.X = 1
'obj.position.Y = 1
msg_obj3d.position.z = 1
Rb3DSpace1.objects.Append msg_obj3d


Rb3DSpace1.FloodDirection.Z = 2.62
Rb3DSpace1.Update

editfield1.text = str(msg_obj3d.ShapeCount)
editfield2.text = str(Rb3DSpace1.Objects.Count)

msg_picture = nil
msg_obj3d = nil


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Apr 10, 2006 6:36 pm 
Offline

Joined: Fri Sep 30, 2005 9:18 am
Posts: 310
I threw my LeakCheck classes at it, and it looks like every time you run the above code, a new Vector3D object is created and never disposed of. When I first run the code, there are 5 Vector3D objects, the next run there are 7, then 8, 9, 10...

I don't know much about RB3D, but that looks like a (relatively small) leak to me, assuming Vector3D doesn't eat too much RAM. But it does look like a definite leak, since the Vector3D object(s) are being created somewhere in the framework rather than by your code.

_________________
Mark Nutter


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 11, 2006 9:36 am 
Offline

Joined: Mon Jan 23, 2006 4:57 pm
Posts: 65
I thought this was some sort of leak. But I'm new to rb3d. Its big enough that after a short time period virtual memory run out. Thanks for the help. I will report this to RB.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 11, 2006 3:28 pm 
Offline

Joined: Tue Dec 27, 2005 8:10 am
Posts: 502
Location: Sweden
louiscastoria,
what happened with this? I am also a bit new to RB3d and have the same problems when trying to draw big objects in full screen. Each time I do an Objects.Remove I get two lingering Vector3D objects. Is there a bug report I can sign on to?

Cheers,
/Mattias

_________________
Mattias Sandström (using RB Studio 2009r5.1 and 2011r3 on Windows 7 (64-bit))


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Oct 29, 2006 3:17 pm 
Offline

Joined: Sun Oct 29, 2006 11:55 am
Posts: 13
Location: Kleve, Germany
Hello,

anything new about this topic? I do have a similar problem with Object3D.AddShapePicture. It seems that the desribed memory leak is still existing [RB 2006R4].
I add hundrets of objects via .AddShapPicture to my scene and remove them later one again (Rb3DSpace.objects.remove Object) but this still leaves quite some resources behind. Rb3DSpace.objects.count shows the correct number but the the reserved memory for the application is exploding...

I tried all kind of things but nothing is working.
Who can help?

Hagen


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 02, 2006 9:10 am 
Offline

Joined: Mon Jan 23, 2006 4:57 pm
Posts: 65
Here is the Report ID: gdavncti

My original report does not show that it has even been reviewed.

Here is the link

http://www.realsoftware.com/feedback/vi ... d=gdavncti

_________________
RB 2007r3
vista sucks Back to XP


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 02, 2006 5:44 pm 
Offline

Joined: Sun Oct 29, 2006 11:55 am
Posts: 13
Location: Kleve, Germany
THX

What a pity that this issue has not been solved yet.

Tschau

Hagen


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Nov 16, 2006 7:42 pm 
Offline

Joined: Sun Oct 29, 2006 11:55 am
Posts: 13
Location: Kleve, Germany
Hello

I have tested all kind of workarounds for this. I have created a starfield with changing star pictures (depending on the distance to the camera).
My first code added the stars with .AddPicture(Mask) to the RB3D space and removed the again in a timer object - this ended up with the above described huge memory leak.
The only workaround I found is to use own generated trimesh objects in a fixed array and to make them visible/invisible if needed. The texture of the trimesh objects can be changed very fast without any memory leak problems. I'm using a fixed array (created in the .open method of the RB3D space) because adding and removing trimesh objects is also leaving always one Vector3D object behind.

I hope this might help somebody

Hagen


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 12, 2007 9:31 am 
Offline

Joined: Mon Mar 12, 2007 3:16 am
Posts: 26
RB3d add/remove memory problem still exist in RB2007 r2 ?
Regards


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 13, 2007 6:41 am 
Offline

Joined: Sun Apr 30, 2006 7:01 am
Posts: 34
According to RB2007r2 release notes:

Quote:
[Fix] [All] Object3D: AddShapePicture and AddShapePictureWithMask no longer leak memory (Feedback ID: gbpjoqer)


Hopefully this fixes the problem in feedback report gdavncti ??


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Apr 13, 2007 8:04 am 
Offline

Joined: Mon Mar 12, 2007 3:16 am
Posts: 26
Thanks Australopithecus,

Could Somebody give ok for "gdavncti report " ?
Best Regards.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group