Advertisement Jump to content
Sign in to follow this  


This topic is 1768 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having issues that none have been able to help me with. I am trying to resolve an issue with my warsow server crashing.

I'm using angel script to create a mod. the games play well but during game changes when variables and classes are being reset it is crashing.

it seems to relate to memory, and how many clients are in the game.


I saw this topic: GarbageCollect(asGC_FULL_CYCLE | asGC_DESTROY_GARBAGE) or command line listed but was not sure exactly how to use it, or if i even could use it.  Any insight on this or how I might possible add something to my class destructors to help with this problem would be greatly appreciated.


Thanks in advance for you input.





Share this post

Link to post
Share on other sites

GarbageCollect(asGC_FULL_CYCLE | asGC_DESTROY_GARBAGE) would do a complete cycle to destroy all known garbage (i.e. objects in the garbage collector that has reached refCount == 1). It would not attempt to detect garbage that might be hidden due to cyclic references. 


To detect and destroy garbage that is kept alive due to cyclic references you would need to use the flag asGC_DETECT_GARBAGE too. The default argument to the GarbageCollect does just that, so if your intention is to find and destroy all garbage, then you can call the method without any arguments.



What can you tell us about the server crash? Do you think it crashes due to consuming too much memory? Or do you think it crashes due to some memory corruption? Can you show us the call stack for where the crash occurs?


What OS is your server running on? Is it Linux? 32bit or 64bit? What version of AngelScript are you using?



If you suspect the problem has to do with the garbage collection, then I suggest you implement a routine to gather some information from the garbage collector throughout the execution. The method GetGCStatistics provides information on how many objects are known to the garbage collector, and how many it destroys, as well as how many circular references it detects and breaks throughout the execution. If you need to inspect individual objects, you can get the address of the object with GetObjectInGC. This method also gives you a sequence number which will give you an idea of how long the object has been in the garbage collector. This same sequence number was returned by NotifyGarbageCollectorOfNewObject, so if you suspect a specific object is causing the problem and can reproduce the exact same scenario repeatedly, then you can set a break point on this call to determine where the object was originally created.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!