Memory Leak

Hello! 🙂

It seems I have a memory leak within my project. The ram keeps rising and rising until eventually running out of memory and crashing 🙁 Is there anyway to profile which plugin could be the source of the leak aside from turning of plugins and testing the game over and over. I had a look in the developer tools (f8) but to be honest I'm not sure what I'm looking for. Any help with this would be super helpful! 🙂

I'm using v1.5.2

Thanks
Can you try updating to 1.6 and see if that solves it, maybe?
I once had memory issue with SRD_GameUpgrade plugin. The memory usage kept raising up when I was play-testing my game, and after half an hour, it became unplayable. If you are using this plugin, I recommend you to remove it from your game.
@Kyuukon Not really possible. A lot of my plugins i doubt are compatible with v1.6. I thought most if not all memory leaks were fixed in 1.5.2?

@JamesRyan Ah thanks, but yeah i don't use that plugin :/
@Drifter92
1) is the 1.5.2. the editor version or the engine version?
If you don't know the difference, then open the project's rpg_core.js file with a text editor and read the project version in its title line.

2) all default engine memory leaks have been fixed with 1.5.2, but Degica cannot fix memory leaks that are part of plugins - only the plugin writer can do that. And not all of them even know how to do that...
So if you have a memory leak with 1.5.2 then best guess is that it is part of your plugins and not part of the engine.

3) however we need more info to be able to help no matter where the problem comes from, like a description of what exactly you're doing and screenshots of your plugin manaer.
@Andar Hi thanks for the reply 🙂
The core files read v1.5.2

I'm aware it's most likely a plugin i have and not the default engine code. My problem is that i would like to be able to narrow down which plugins are the problems so i can either contact the plugin makers or commission help to fix the issue with any plugins that are no longer supported.

I'll attach a list of my plugins but I'm afraid i doubt this will be help much as there a quite a few.
I'ts hard to pinpoint what exactly is doing it, I thought it might be going to lots of different maps but I'm not sure. I'll try turning some plugins on/off for now as I don't know how to use the chrome dev tools.

Spoiler: Plugins
1.jpg
2.jpg
3.jpg
4.jpg
You can only check this by deactivating one plugin after another and testing with a new game for each different plugin combination until you find out which plugin (or which combination of several plugins) create the memory leak.
and yes, it is possible that every single plugin for itself works correctly and only a combination (from different scripters) creates the problem.

That said - does your preloader plugin have commands to unload resources? and if yes, are you using those commands?
If no that plugin would be my first guess - because preloading resources can disable the automatic garbage collection for them (and it is that garbage collection that frees memory after a resource is no longer used).
I think the best shot you can give is to upgrade to version 1.6.2 of rmmv.
If you have plugins that are not compatible with the upgrade you can substitute them for other that do the same function, like the GTP for example.
Also you can put the plugins of the same author together like the galv ones.
@Eliaquim if the memory leak is in a plugin, updating will do absolutely nothing to solve it.
Additionally,there are no replacements for several of SRD's plugins and programs which do not function under 1.6.x, because SRD worked at a completely different level compared to most of the other plugin writers, and he has left the community before 1.6.x came out.
@Eliaquim if the memory leak is in a plugin, updating will do absolutely nothing to solve it.
Additionally,there are no replacements for several of SRD's plugins and programs which do not function under 1.6.x, because SRD worked at a completely different level compared to most of the other plugin writers, and he has left the community before 1.6.x came out.
IF are the plugins the problem, you are right.
Also i use a lot pf plugins of srd in my project 1.6.2 and i dont see this incompabilities. If the OP need help maybe i can do something about it.
But he tells that he wont upgrade because some plugins dont work with recent version of rm mv code.
So i tell him he can upgrade and substitute the plugins that are incompatible with others plugins that have the same function.
@Drifter92 maybe the plugins that cause the memory leak can be those that not working with the 1.6.2.
So if you want, tell me and i find the properly substitute and give to you.
This is not the only way to resolve your problem, but is a way we can try.
Or you can do the others way too. Anyway, wish you luck! ^^
@Andar & @Eliaquim Thanks for the help! I watched my ram usage carefully and found that when one of my newer plugins was enabled the memory began to rise. I contacted the plugin creator and they fixed the issue perfectly 😀 So my issue looks resolved 😂

I think i got lucky with this though and still don't know how to properly see where the memory is going using the debugging tools.. or even if that's possible 🙂
Finding and fixing memory leaks is always tricky. The good news is that RPG Maker uses NW.js, which is based on Chromium/Node, so if you search for "find memory leak chromium", "fix memory leak node", "fix memory leak NW.js" you'll probably come up with something useful. Here's an example article/tutorial.

When you playtest you'll want to open up the dev tools (press F8 or F12) and use the Memory tab to analyze the memory usage.
@Aloe Guvner Thank you. The article seems helpful 🙂

Original thread: https://forums.rpgmakerweb.com/threads/memory-leak.106032/