Results 1 to 10 of 10

Thread: Reflection Memory maxing out

  1. #1
    Join Date
    Mar 2015
    Posts
    28
    Mentioned
    1 Post(s)
    Quoted
    13 Post(s)

    Question Reflection Memory maxing out

    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 . 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 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
    Code:
    -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

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

    Clownhair

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    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.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Mar 2015
    Posts
    28
    Mentioned
    1 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    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?
    Last edited by Clownhair; 03-12-2016 at 03:28 PM.

  4. #4
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    we have this
    , 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.

  5. #5
    Join Date
    Mar 2015
    Posts
    28
    Mentioned
    1 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    we have this
    , 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:

    Code:
    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.

  6. #6
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    It doesn't manage memory for everything...

  7. #7
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    What memory apart from widgets does the include not handle?
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  8. #8
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    What memory do you think it handles? Because last I checked there wasn't a garbage collector in the include.

  9. #9
    Join Date
    Mar 2015
    Posts
    28
    Mentioned
    1 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by tls View Post
    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?

  10. #10
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by Clownhair View Post
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •