Jump to content

Program gets progressivly slower


Cole Chapman
 Share

Recommended Posts

Ah, yes GCCollect() makes more sense than calling GCSetMode() again.

 

I did both GCCollect AND removing all Garbage Collection codes and they both run on par with each other (I saw higher spikes with removing but it was only a few frames

So I need to know if not having GCCollect is okay and I guess what does it exactly do?

 

It should be fine to leave out, but don't hold me to that though. Then I'm again, I'm a C nerd, and take care of my mallocs anyway so I've never found myself living by a garbage collector (Maybe we should call it a "bin man" because it's quicker)...

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Function GCSetMode( mode ) 
Description Set garbage collector mode 
Information mode can be one of the following:
1 : automatic GC - memory will be automatically garbage collected
2 : manual GC - no memory will be collected until a call to GCCollect is made

The default GC mode is automatic GC.  

 

and as Josh stated here in this post's first page:

Add a call to GCCollect() in your main loop.

 

I don't recommend using the auto GC mode because it is possible for it to cause crashes. The problem is object Delete() methods might be called at any time, and in the case of OpenGL or Newton objects, it might cause the program to delete these things during a sensitive routine when they are being used. It might do something like delete an OpenGL buffer while another buffer is being set, and it is possible this might cause a crash in some situations.

 

In the future I will add the deleted objects to a queue to be deleted during the UpdateWorld() routine, so they will be more safe in auto GC mode, instead of deleting them in the Object Delete() method.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...