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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    68 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    24 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    27 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    54 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X