Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Memory Management

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

    Memory Management

    How does Ninja 6.5 handle memory allocation and de-allocation?
    For example, I am keeping an array of type Iorder, for which I allocate memory once only in Initialise and set all elements of this array to null initially. Then I store the results of calls to EnterLongStop and EnterShortStop in this array. When a trade completes (which I detemine simply by the value of Close[0], as each trade has a profit target) I reset the appropriate array element to null, so that it can be reused. Will this cause memory leaks? Should I be freeing the memory used by the IOrder structure returned from EnterLongStop and EnterShortStop before setting the array element to null? The reason I ask is that although the strategy works it slows down and eventually hangs the more times I run it.
    Thanks for your help.
    Annette

    #2
    Annette, the memory management is handled by the .NET garbage collection automatically - whenever resources are freed up, the garbage collector can release them on the next run, however we would can't 'force' this process to 'kick' in the IOrder objects would not need explicit resource cleaning from your end.

    Have you isolated the array to be the issue of your memory usage challenges?

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X