PDA

View Full Version : Reflection Memory maxing out



Clownhair
03-12-2016, 01:23 PM
Greetings,

A couple of weeks ago I switched from Aerolib to Reflection for fun/learning experience and have been playing with it since that time.

However after running my script for a couple of hrs (mostly at 9h+ /w breaks) i get this error (http://prnt.sc/acqftl) . Java process maxing out of memory on my server (+- 250 mb).
After watching the script for a while i've noticed that my memory grows whenever he loads in a part of the map/game when you're running around (so when the screen goes black and says please wait or something like that).
Note: sometimes after walking and having to load in map, the memory slowly drops again over a period of time but sometimes it doesn't so it keeps on adding up.

Research also suggested this post by Kyle/Elfy (https://villavu.com/forum/showthread.php?t=115545&highlight=memory) saying that all memory management is done by the include except for widgets. The only time I use this is for the Reflect.Bank.isOpen/Close. Anyone knows if you have to do some manual memory management here?

Can anyone confirm that they've had the same problem / don't have the problem with a script running a decent amount of time and walking ingame?

OR

Does anybody know how i can give one of these params to the SmartSpawnClient proc so I can increase my heap size since I only want it to run 1/2hrs more


-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size

java -Xms16m -Xmx64m ClassName

Into



Self.Target := SmartSpawnClient(JavaString, StringReplace(PluginPath, '\',
'/', [rfReplaceAll]), Format('http://oldschool%s.runescape.com/', [World]),
'j1', Width, Height, '', UserAgent, '', '');

Gratz in advance

Clownhair

KeepBotting
03-12-2016, 02:20 PM
Well I can't speak as to Reflection's memory management but I'm pretty sure the launch args for SMART are in the JavaString string. So you could add your -Xms and -Xmx there.

Clownhair
03-12-2016, 03:20 PM
Well I can't speak as to Reflection's memory management but I'm pretty sure the launch args for SMART are in the JavaString string. So you could add your -Xms and -Xmx there.

I thought the JavaString was used to find it on the disk.

I've tried adding arguments there but then i get the error that windows can't find that path and to make sure i typed the name correctly.
Also tried by adding the params in the currently empty string params for SmartSpawnClient but no succes (set max mem really low so i suspect that it would stop working on startup but it succeeds my max set mem)

You have any idea where i can find parameter list definition of SmartSpawnClient?

Turpinator
03-12-2016, 04:43 PM
we have this
http://i.imgur.com/psGFowR.png, but i do believe the params param is not what you think it is. its the params of the url or something.

You can probably find more info by examining the code that makes up smartspawnclient in benrand's smart github.

Clownhair
03-12-2016, 06:35 PM
we have this
http://i.imgur.com/psGFowR.png, but i do believe the params param is not what you think it is. its the params of the url or something.

You can probably find more info by examining the code that makes up smartspawnclient in benrand's smart github.

Thanks for the parameter list!!(didn't know there was a github for smart) I know knew for sure i had to insert it after the ua. After some tinkering my test now worked as intended (crashing when logging in with very low allocated memory), so it should help my problem by increasing the memory (we'll see tomorrow).

For the people interested this is now my SmartSpawnClient:



Self.Target := SmartSpawnClient(JavaString, StringReplace(PluginPath, '\',
'/', [rfReplaceAll]), Format('http://oldschool%s.runescape.com/', [World]),
'j1', Width, Height, '', UserAgent, '-Xms500m -Xmx750m', '');


Feedback on the memory consuming map/graphics loading is still appreciated.

tls
03-13-2016, 07:00 AM
It doesn't manage memory for everything...

Joopi
03-13-2016, 08:13 AM
What memory apart from widgets does the include not handle?

tls
03-13-2016, 06:16 PM
What memory do you think it handles? Because last I checked there wasn't a garbage collector in the include.

Clownhair
03-13-2016, 09:17 PM
What memory do you think it handles? Because last I checked there wasn't a garbage collector in the include.

Well there is the whole memory.simba file that frees up objects after using them? In your very short previous post you said "It doesn't manage memory for everything...".

Do you know what it does manage or?

tls
03-13-2016, 10:03 PM
Well there is the whole memory.simba file that frees up objects after using them? In your very short previous post you said "It doesn't manage memory for everything...".

Do you know what it does manage or?

It doesn't free your objects, but it does make it easier to free them. The biggest purpose of the memory management is to keep some pointers(that don't change often) alive, so that operations take less reflection calls and thus less time.