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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    125 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    105 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    85 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    105 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    85 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X