Memory Leaks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • OzPunter
    Junior Member
    • Apr 2009
    • 161

    #1

    Memory Leaks

    I anybody else experiencing memory leaks when calling MarketBook?

    I inserted this code in my program and it shows a loss of over 8k on each call to MarketBook.

    function MemoryUsed: cardinal;
    var
    st: TMemoryManagerState;
    sb: TSmallBlockTypeState;
    begin
    GetMemoryManagerState(st);
    result := st.TotalAllocatedMediumBlockSize + st.TotalAllocatedLargeBlockSize;
    for sb in st.SmallBlockTypeStates do begin
    result := result + sb.UseableBlockSize * sb.AllocatedBlockCount;
    end;
    end;

    I adapted the Delphi Client example code because it appeared easier to do that than to create a whole bunch of new code to do the same thing and now I’m haemorrhaging memory.

    Any thoughts?

    Has anyone else run the Delphi Client Example to get prices repeatedly?


    Kind Regards
    OzPunter
  • OzPunter
    Junior Member
    • Apr 2009
    • 161

    #2
    Originally posted by OzPunter View Post
    I anybody else experiencing memory leaks when calling MarketBook?

    I inserted this code in my program and it shows a loss of over 8k on each call to MarketBook.

    function MemoryUsed: cardinal;
    var
    st: TMemoryManagerState;
    sb: TSmallBlockTypeState;
    begin
    GetMemoryManagerState(st);
    result := st.TotalAllocatedMediumBlockSize + st.TotalAllocatedLargeBlockSize;
    for sb in st.SmallBlockTypeStates do begin
    result := result + sb.UseableBlockSize * sb.AllocatedBlockCount;
    end;
    end;

    I adapted the Delphi Client example code because it appeared easier to do that than to create a whole bunch of new code to do the same thing and now I’m haemorrhaging memory.

    Any thoughts?

    Has anyone else run the Delphi Client Example to get prices repeatedly?


    Kind Regards
    OzPunter
    Actually this Memory Leaks problem has raised some concerns.

    A search of the web shows several discussions about the problem and so far I haven’t established exactly where the problem lies. The SuperObject, or DBXJSON, but I’m reasonably sure it’s not my stripped back code.

    Anyone want to comment on this?

    Comment

    Working...
    X