Mumbles Posted July 22, 2011 Share Posted July 22, 2011 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)... Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
macklebee Posted July 22, 2011 Share Posted July 22, 2011 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. Quote 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 More sharing options...
Cole Chapman Posted July 22, 2011 Author Share Posted July 22, 2011 Well anything with memory is generally important (just a logical rule of thumb) but if I dont have it, does that mean that (and this is an uneducated guess) more memory will be allocated for my program as I load and delete more and more things? Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 22, 2011 Share Posted July 22, 2011 if you do not use the GCSetMode then the default in bmax is for garbage collection to be automatic which Josh stated above might cause issues for you. Quote 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 More sharing options...
Cole Chapman Posted July 22, 2011 Author Share Posted July 22, 2011 Ah, I thought the auto GC was something in Leadwerks. Thanks for the info man! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.