Results 1 to 6 of 6

Thread: Memory Usage

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Memory Usage

    Hi.

    Why does this :
    atpahere:=FilterATPASize(atpahere,3,25,36,160);

    Uses more Memory than making this ?:
    atpahere2:=FilterATPASize(atpahere,3,25,36,160);

    SO generally it seems when you give the same variable to a function that you use for the return value, its requiring more memory. I found that out by debugging my script, that seemed to eat quite some memory at one point.

    ~caused

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Considering that a large array is used, you would have the original array plus the filtered array being stored where as the first only has the filtered array stored.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    But the first one is using more memory :x.

  4. #4
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Explain to me in detail how you know this?

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  5. #5
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    wow xD ok..
    I Looped the following function and checked the scar memoey usage in task manager.

    It was increasing nonstop.

    Than i switched the "filteredfire" T2DPointarray to "filteredfirex". And it didnt increase.

    scar Code:
    Function FindMiningSite:TPoint;
    var
    fires,fires2,fires3,fires4 : TpointArray;
    FilteredFires,FilteredFiresx : T2DPointArray;
    x,y,i,timer : integer;
    grabtime : integer;
    begin
    try
    FindColorsTolerance(fires,2836599,556,5,706,167,5);
    FindColorsTolerance(fires2,1649728,556,5,706,167,5);
    FindColorsTolerance(fires3,2902644,556,5,706,167,5);
    FindColorsTolerance(fires4,1916496,556,5,706,167,5);
    except
    end;

    try
    fires := CombineTPA(fires,fires2);
    fires := CombineTPA(fires,fires3);
    fires := CombineTPA(fires,fires4);

    FilteredFires := SplitTpaex(fires,3,3);//TpaToAtpaEx(fires,50,50);

    x:= 627;
    y:= 659;

    FilteredFiresx:=Killboxes(filteredfires,10,100,45,150);

    SortATPASize(FilteredFiresx,TRUE);
    except
    end;
    try
    //debugatpabounds(filteredfires,'');
    except
    end;
    try
    MiddleTPAEx(FilteredFiresx[0],x,y);
    except
    end;

    If high(FilteredFiresx) >0 then
    result := Point(x,y);

    end;

  6. #6
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    One of the mysteries of Scar - I can not think of any way it would be possible.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

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
  •