Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

as memory leaks?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Aggrav8d   Members   -  Reputation: 133

Like
0Likes
Like

Posted 12 December 2004 - 02:06 PM

I'm into the final stages of development on my project so I thought i'd run it through paul nettle's memory manager (www.fluidstudios.com) and it got very annoyed with angelscript (currently working with 1.10.1WIP1). I will resolve the memory leaks on my end, I just thought it was worth mentioning to whom it may concern. :)

Dan Royer, OwnerMarginally Clever Games

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3443

Like
0Likes
Like

Posted 13 December 2004 - 12:55 AM

I'm not aware of any memory leaks in AngelScript. Would you mind helping me by pointing out in what situations you get memory leaks? Neither of my test frameworks report any memory leaks.

I can't access fluidstudios.com from here (it's barred by the company's proxy) so I can't check out Paul's memory manager. How does it work? Is it free?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 Aggrav8d   Members   -  Reputation: 133

Like
0Likes
Like

Posted 13 December 2004 - 05:27 AM

It is free and you just plug it in somewhere convenient like as_config.h and recompile. it doesn't actually optimize memory allocation by partitioning of small sections from a few large allocations - rather it works a lot like boundschecker to veryify that every single byte allocated has been freed & can even tell you when you are allocating blocks bigger than is actually needed. The mmgr complains some 20 times if I

a=asCreateScriptEngine(ANGELSCRIPT_VERSION);
delete a;

and once or twice for every Register...() call.

You can also get it here: ftp://ftp.flipcode.com/code/mmgr.zip

Dan Royer, OwnerMarginally Clever Games

#4 Andreas Jonsson   Moderators   -  Reputation: 3443

Like
0Likes
Like

Posted 13 December 2004 - 05:32 AM

Interesting. Thanks for the alternative link. I'll download it and see what it says.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#5 Andreas Jonsson   Moderators   -  Reputation: 3443

Like
0Likes
Like

Posted 13 December 2004 - 09:09 AM

I plugged in Paul's memory manager in the library and gave it a run. I didn't find any memory leaks, but there are a few places where AngelScript apparently deletes memory that it never allocated. I'm currently tracking these down.

The first one I found was not in AngelScript but in MSVC++'s std::string's destructor.

Did you find any actual memory leaks in AngelScript?
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#6 Andreas Jonsson   Moderators   -  Reputation: 3443

Like
0Likes
Like

Posted 13 December 2004 - 09:11 AM

Quote:
Original post by Aggrav8d
The mmgr complains some 20 times if I

a=asCreateScriptEngine(ANGELSCRIPT_VERSION);
delete a;

and once or twice for every Register...() call.


I hope you're not actually calling delete on the script engine? You should be calling a->Release();

I don't get any complaints on the Register...() calls.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#7 Andreas Jonsson   Moderators   -  Reputation: 3443

Like
0Likes
Like

Posted 13 December 2004 - 11:50 AM

After removing the illegal delete in std::string, the memory manager no longer reports any problems with the AS library or the test framework.

AngelScript doesn't actually use std::string, so the problem actually not with the library itself.

Let me know if you still have trouble with AS.

Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#8 Aggrav8d   Members   -  Reputation: 133

Like
0Likes
Like

Posted 13 December 2004 - 06:16 PM

Good to know. ...i'm embarassed to say that, yes, i was deleting it. I guess I didn't read the doccos closely enough. That was the source of the problems. Why isn't the destructor protected or private?

Dan Royer, OwnerMarginally Clever Games

#9 Andreas Jonsson   Moderators   -  Reputation: 3443

Like
0Likes
Like

Posted 14 December 2004 - 12:54 AM

Good question. I simply forgot about it. I'll add it to 2.0.0. I won't add it to 1.10.1 because it changes the interface.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS