SRL Archive - OSR Help

memory leak


Shuttleu

2011-08-02 07:08:21

now im sure this is not to do with the script, but there is a memory leak, so it could be in smart, simba or reflection (most likely reflection)

im using Homes Essence Miner
i have 4GB RAM
and core i5 processor

i have been watching the memory and processor usage of simba and during the mining the processor goes up to about 50% (compared to about 15~20% for the rest of the script (this is probably the script fault)) and when it banks the essence the ram usage goes up about 200kB~2MB

~shut

Wizzup?

2011-08-02 07:34:04

Could be a reflection problem?

Shuttleu

2011-08-02 07:36:02

From: Wizzup?
Could be a reflection problem?


yes it could, forgot about reflection

im assuming its probably to do with npc finding though

~shut

Flight

2011-08-02 07:40:00

During just the mining? That pretty much says right there it's a Reflection/Script issue. I haven't seen the script, but I assume it's constantly checking your player's animation while mining? Or does it constantly check your Inventory Count?

Shuttleu

2011-08-02 07:45:46

From: Flight
During just the mining? That pretty much says right there it's a Reflection/Script issue. I haven't seen the script, but I assume it's constantly checking your player's animation while mining? Or does it constantly check your Inventory Count?


its constantly checking the animation, but what im more worried about is the 200kB~2MB every bank

~shut

Flight

2011-08-02 07:55:33

From: Shuttleu
its constantly checking the animation, but what im more worried about is the 200kB~2MB every bank

~shut


I don't quite understand, before you said during the mining is when your memory usage rocketed, but also when you're banking? Which part of the 'banking process' is your memory being used up?

Home

2011-08-02 08:02:44

Just noticed that :S Wtf.


procedure MineEss;
var C: Integer;
Essence: TRSObject;
begin
if not LoggedIn then Exit;
C := 0;
R_Flag;
FindEssence;
while not R_InvFull do begin
if not LoggedIn then Exit;
if not R_WaitToAnimate(2000) then
if not FindEssence() then Inc(C);
RRandoms;
AntiBan;
if C > 2 then
begin
SDebug(' We Have Failed To Find Essence Over 3 Times, Trying To Re-Locate Correct Position');
if WalkToEss then begin
SDebug(' Re-Locating Successfull');
C := 0;
end;
end;
if C > RandomRange(10, 15) then LogOut;
end;
SDebug(' Inventory Full');
end;


Edit: It's because of R_WaitToAnimate;



~Home

Shuttleu

2011-08-02 08:25:02

From: Flight
I don't quite understand, before you said during the mining is when your memory usage rocketed, but also when you're banking? Which part of the 'banking process' is your memory being used up?


the CPU rockets during mining
the RAM increases during banking

i cant tell when now because it seems to have capped itself at aroung 500MB

~shut

Nava2

2011-08-02 12:46:45

Home, place a Wait(16) in that loop. It will ease the processor usage significantly.

Home

2011-08-02 12:51:07

From: Nava2
Home, place a Wait(16) in that loop. It will ease the processor usage significantly.


Ok. Will do thanks for the tip :)!


~Home

Shuttleu

2011-08-02 12:54:44

the script has finished and smart is closed, but it has not freed the ram back to the system

~shut

Nava2

2011-08-02 12:56:54

From: Shuttleu
the script has finished and smart is closed, but it has not freed the ram back to the system

~shut


Close Simba?

Shuttleu

2011-08-02 13:04:13

that frees the ram, but it should free it when the objects are destroyed (when the script is stopped or smart is closed)

~shut

Flight

2011-08-02 21:08:12

From: Shuttleu
that frees the ram, but it should free it when the objects are destroyed (when the script is stopped or smart is closed)

~shut


I agree with this.

Drakan

2011-08-02 21:37:06

Also makes a difference to know if it's reflection 1 or 2. I assume home's script uses reflection 1 aye?

Flight

2011-08-02 21:47:27

It's R2.

Nava2

2011-08-03 00:53:07

If it is freed when Simba is closed, it could be an issue with Simba not with R2. Perhaps SMART is holding memory "hostage" for lack of a better term until its parent (Simba) frees it.

Shuttleu

2011-08-04 16:39:12

From: Nava2
If it is freed when Simba is closed, it could be an issue with Simba not with R2. Perhaps SMART is holding memory "hostage" for lack of a better term until its parent (Simba) frees it.


my main problem with that is if you are like me where when the script ends you start another script and it creates another smart (assuming you close smart or change world in the script) and uses more ram (whether you close smart or not)

~shut

Yago

2011-08-04 17:23:26

From: Shuttleu
my main problem with that is if you are like me where when the script ends you start another script and it creates another smart (assuming you close smart or change world in the script) and uses more ram (whether you close smart or not)

~shut


same thing i do