Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT Doesn't Seem to release memory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT Doesn't Seem to release memory

    I am using various lists in my strategy - for tracking instruments and orders.

    I initialize these lists at the start of my strategy, and apply list.Clear() to them in the OnTermination block of my code, but it seems like they are never released from memory.

    This becomes a significant issue if I am performing optimizations, since the memory usage from NinjaTrader quickly escalates (To the point after ~1500 optimizations, it is using all of the 12GB of RAM that I have installed).

    Even if I close the strategy analyzer window, and only leave the main control center open (ie, I don't have any charts, etc open) this memory still isn't released. The memory usage from NT will stay at that elevated value (~12GB) until I close and restart the program.

    Is there something that I am missing here? MSDN says that the garbage collector should automatically clean up these lists after they're not needed any more, but it seems like NT is keeping them open for some reason.

    I would appreciate any advice on the matter....

    Thanks

    #2
    Originally posted by kbeary33 View Post
    I am using various lists in my strategy - for tracking instruments and orders.

    I initialize these lists at the start of my strategy, and apply list.Clear() to them in the OnTermination block of my code, but it seems like they are never released from memory.

    This becomes a significant issue if I am performing optimizations, since the memory usage from NinjaTrader quickly escalates (To the point after ~1500 optimizations, it is using all of the 12GB of RAM that I have installed).

    Even if I close the strategy analyzer window, and only leave the main control center open (ie, I don't have any charts, etc open) this memory still isn't released. The memory usage from NT will stay at that elevated value (~12GB) until I close and restart the program.

    Is there something that I am missing here? MSDN says that the garbage collector should automatically clean up these lists after they're not needed any more, but it seems like NT is keeping them open for some reason.

    I would appreciate any advice on the matter....

    Thanks
    Garbage collection is pretty much unpredictable. You may have to do what we are advised not to do, and explicitly call the Garbage Collector, or explicitly Finalize() the lists.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Balage0922, Today, 07:38 AM
    0 responses
    1 view
    0 likes
    Last Post Balage0922  
    Started by JoMoon2024, Today, 06:56 AM
    0 responses
    6 views
    0 likes
    Last Post JoMoon2024  
    Started by Haiasi, 04-25-2024, 06:53 PM
    2 responses
    19 views
    0 likes
    Last Post Massinisa  
    Started by Creamers, Today, 05:32 AM
    0 responses
    6 views
    0 likes
    Last Post Creamers  
    Started by Segwin, 05-07-2018, 02:15 PM
    12 responses
    1,786 views
    0 likes
    Last Post Leafcutter  
    Working...
    X