Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] Plugins cause memory leaks

Author
Message
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 15th Jun 2017 18:06 Edited at: 15th Jun 2017 18:09
Sorry for posting a 2nd thread about this, but I feel it may need to be an actual bug report. It's not specific to C# either, so the title of the other thread is misleading.

Any plugin I try, be it my own, TGC's example plugin, or plugins downloaded from the forum causes what seems to be a memory leak (not sure if that is the correct term in this case). It's not very noticeable until you start using multiple plugin functions that need to be called every frame. Each function call uses a bit of memory and that memory is not freed until the program is closed.

As an example, I have an AppGameKit wrapper function that calls a set of plugin functions to transform a world 3D position to the camera's local space. Calling this 6 times per frame causes my program to go from ~60mb of memory usage to ~1GB in just over a minute.

I figured I was probably just handling something wrong in my plugin code, but I get the same problem with TGC's own example plugin by calling SetI() and GetI() every frame. I've posted a video of this below.

I hope this can be addressed, or that I'm just missing something as I'm new to writing plugins. Plugin support was my reason for coming back to AppGameKit from Unity. I've been a fan of TGC's programming languages since DB Classic, but the lack of modern audio support and a few other things (without needing to learn C++) was keeping me away from AGK. Plugin support solves these issues.

I am on Windows 10. No idea if this occurs on other OS's.

Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 17th Jun 2017 22:26
Hi hendron. Nothing to add, but I can confirm I'm seeing the same problem on my own Windows 10 machine, both with TGC's example plugin and with one of my own. It's easy to miss in TGC's PluginTest project because the frame rate is capped at 30 so it creeps up really slowly, but the problem is still there.

Even an example as simple as this demonstrates the problem.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 18th Jun 2017 04:11
Hi Lucas, thanks for confirming! Hopefully it'll be on TGC's radar for an update.

Login to post a reply

Server time is: 2024-11-24 14:28:04
Your offset time is: 2024-11-24 14:28:04