SRL Archive - Bugs

Possible Memory Leak in R2


Coh3n

2011-09-12 23:16:32

Since the official release of R2, I've only used it with MSI, and today my Simba crashed after 20 minutes and the memory usage was over 800k. I wasn't experiencing this with R1, and since this was the first time, maybe the leak is in a random solver? Other than that, MSI uses very little Reflection methods (R_GetSkillLevel and R_GetMyPos are the only ones I can think of).

Anyone else having issues like this?

P.S. Sorry if this was posted elsewhere, I was unable to find it.

Flight

2011-09-12 23:27:24

How often are you checking for randoms via reflection?

I've run my latest Agile Gnome for, so far, 6 hours straight, and it relies alot on Reflection, constantly checking the player's position, whether or not we're animating/moving, our skill experience, gametab, and MM levels, all in reflection. The difference is I only call R_FindRandoms after an object has not been completed after X amount of seconds or if we're not within a specific region. This is immensely cut down on Memory, so I wonder if the problem lies with Reflection randoms?

Drakan

2011-09-13 01:00:05

I just tested my plugin with the memory management built in, and it didn't detect any memory leaks in R_FindRandoms. I haven't tested much else, but I feel safe to say it isn't that.

Coh3n

2011-09-13 01:19:45

From: Drakan
I just tested my plugin with the memory management built in, and it didn't detect any memory leaks in R_FindRandoms. I haven't tested much else, but I feel safe to say it isn't that.
Maybe not R_FindRandoms itself, but what about the actual solvers?

mormonman

2011-09-13 01:44:27

From: Coh3n
Maybe not R_FindRandoms itself, but what about the actual solvers?


Do the global vars need to be "freed"?

Coh3n

2011-09-13 02:02:21

From: mormonman
Do the global vars need to be "freed"?
In MSI? No. Nothing in MSI changed other than moving from R1 to R2. I honestly don't know anything about Reflection, that's why I posted. :)

mormonman

2011-09-13 02:35:33

From: Coh3n
In MSI? No. Nothing in MSI changed other than moving from R1 to R2. I honestly don't know anything about Reflection, that's why I posted. :)


for example, if you have global variables in an include file and then get "initialized" everytime the random is found, do they need to be freed? It probably won't solve this issue I'm just curious.

Coh3n

2011-09-13 10:11:37

From: mormonman
for example, if you have global variables in an include file and then get "initialized" everytime the random is found, do they need to be freed? It probably won't solve this issue I'm just curious.
Just happened again, and no, all MSI does is call R_FindRandoms.

E: Going to run without Reflection randoms and see.

Drakan

2011-09-13 10:32:43

From: Coh3n
Just happened again, and no, all MSI does is call R_FindRandoms.

E: Going to run without Reflection randoms and see.


He's referring to the global vars we have in reflection. And which solvers actually ran during this? I went through and called R_FindRandoms which calls detection for every random in there. I don't see 1 or 2 calls to a random solver causing 800k mem usage, but if they are I need to know which solvers it called.

Coh3n

2011-09-13 19:06:02

From: Drakan
He's referring to the global vars we have in reflection. And which solvers actually ran during this? I went through and called R_FindRandoms which calls detection for every random in there. I don't see 1 or 2 calls to a random solver causing 800k mem usage, but if they are I need to know which solvers it called.
I couldn't tell you. Since SMART crashes I can't see the debug. I'm going to run Simba through the terminal and see what I get.

I also ran MSI without Reflection randoms and yielded the same result so it's likely nothing to do with Reflection. It could be in MSI I suppose, but I have no idea what changed, nor what could even cause a memory leak in the first place.

I also just realized that I started using a different SMART when I updated SRL yesterday, and since then, Simba's crashed every time. Ben said nothing but a version string was changed since the Beta and final versions, but I'm going to try the beta version again anyway and see what happens.

If nothing prevails, I'll revert to an earlier version of MSI.

E: Older SMART doesn't seem to do anything, but this comes up in the terminal every time R_FindRandoms is called:

Field not found: Oc
Field not found: Oc
And yes it prints twice. Not sure if that will tell you anything or not.

NCDS

2011-09-13 19:16:44

From: Coh3n
I couldn't tell you. Since SMART crashes I can't see the debug. I'm going to run Simba through the terminal and see what I get.

I also ran MSI without Reflection randoms and yielded the same result so it's likely nothing to do with Reflection. It could be in MSI I suppose, but I have no idea what changed, nor what could even cause a memory leak in the first place.

I also just realized that I started using a different SMART when I updated SRL yesterday, and since then, Simba's crashed every time. Ben said nothing but a version string was changed since the Beta and final versions, but I'm going to try the beta version again anyway and see what happens.

If nothing prevails, I'll revert to an earlier version of MSI.

If it doesn't work try the MSI version in my repo. I have newest SMART and my version of MSI (obviously :p) and I run at a steady 2xxK.

Coh3n

2011-09-13 19:47:13

From: NCDS
If it doesn't work try the MSI version in my repo. I have newest SMART and my version of MSI (obviously :p) and I run at a steady 2xxK.
That's after you merged with my repo. yesterday?

E: Same thing happens with your version.

kingarabian

2011-09-13 20:14:59

From: Coh3n
That's after you merged with my repo. yesterday?

E: Same thing happens with your version.


Maybe you have a program that is conflicting with Simba/Smart??

Drakan

2011-09-13 21:19:26

Field not found warning does not affect anything. It's just a warning SMART gives when a path isnt valid. That specific one is reflection trying to find the text of the music interface tho it doesn't exist at that point in time.

NCDS

2011-09-13 21:28:35

Mine are all now ~330k :/

Coh3n

2011-09-14 00:53:50

From: kingarabian
Maybe you have a program that is conflicting with Simba/Smart??
Not sure what it would be. I'm not running anything out of the ordinary. :confused: Also, could you elaborate? How could a program conflict?

From: Drakan
Field not found warning does not affect anything. It's just a warning SMART gives when a path isnt valid. That specific one is reflection trying to find the text of the music interface tho it doesn't exist at that point in time.
Ah okay. It's been running for 4 hours and it's at 340,000k, which isn't as bad. I just wish there was an easy way to pinpoint the problem.

Jakkle

2011-09-14 01:19:25

From: Coh3n
I also just realized that I started using a different SMART when I updated SRL yesterday, and since then, Simba's crashed every time. Ben said nothing but a version string was changed since the Beta and final versions


https://github.com/BenLand100/SMART/commit/23e550921bfa68b687b3353a80c738a638319a6c
This link shows what he changed, as far as I can see he changed


- if (it == canvas) {
+ if (it == canvas || it == null) {
-             System.out.println("Passing Event: " + e);	
+ //System.out.println("Passing Event: " + e.getKeyChar());

And also what you said he changed.

kingarabian

2011-09-14 01:40:54

From: Coh3n
Not sure what it would be. I'm not running anything out of the ordinary. :confused: Also, could you elaborate? How could a program conflict?

Ah okay. It's been running for 4 hours and it's at 340,000k, which isn't as bad. I just wish there was an easy way to pinpoint the problem.


Well I am running 6 MSI's on 20 players pretty smoothly at less than 180k for each Smart and everyone else has no issue… So it could be a program that is essential to running Simba/Smart (Java?). I used to have an issue with a program causing Scar to crash in the past so yeah.

Coh3n

2011-09-14 01:49:47

From: Jakkle
https://github.com/BenLand100/SMART/commit/23e550921bfa68b687b3353a80c738a638319a6c
This link shows what he changed, as far as I can see he changed


- if (it == canvas) {
+ if (it == canvas || it == null) {
-             System.out.println("Passing Event: " + e);	
+ //System.out.println("Passing Event: " + e.getKeyChar());

And also what you said he changed.
Yeah I already saw that. I've also tried both versions of SMART and the same thing happened.

From: kingarabian
Well I am running 6 MSI's on 20 players pretty smoothly at less than 180k for each Smart and everyone else has no issue… So it could be a program that is essential to running Simba/Smart (Java?). I used to have an issue with a program causing Scar to crash in the past so yeah.
Oo nice! Didn't know anyone used it that much. Also, I'm assuming you're using the version downloaded from the updater? I'm using this version (different branch then what you're using), which is quite a bit different than yours. If you wouldn't mind testing that version that would be awesome. I'd like to see if it really is just me having the issue. You can just disable the MSI updater, rename your current folder to "MSI.stable" and download the TBox_locations branch (latter link) from the link, call it MSI and away you go. ;)

NCDS

2011-09-14 02:00:23

I just ended mine and none were above 350k. I'm not really sure if that's normal as I don't usually check, but I'll start.