-> Did you test whether the memory leak occurs on other than momentum bars?
-> If no, which version of the momentum bars did you install?
-> Did you make sure that no workspace is running in the background?
-> Can you provide us with the exact settings of your chart and all indicators?
-> Do you have any assemblies installed?
-> Do you have other custom indicators installed on NinjaTrader?
For every indicator that you install on NinjaTrader the Initialize() section is executed, even when the indicator is not set up on a chart. This means that any indicator, which you have downloaded into bin -> Custom -> Indicator folder can create the problem. A new installation of NinjaTrader has no impact on the problems.
Best you rename your folder Documents -> NinjaTrader 7 to NinjaTrader 7 old (do not delete it, if you just rename it your decision is reversible). NinjaTrader will then create a new clean folder. You will still be able to copy your indicators, chart and workspace templates to the new installation, just instrument settings and session templates will be lost, as they are not stored separately.
The following 3 users say Thank You to Fat Tails for this post:
I wouldn't use the term "memory leak". It's very unlikely that anyone uses unmanaged code within ninjatrader. The C# objects lifetime will be managed thru the garbage collector very effectively. But a indicator could allocate new objects at every tick and "use" all of the objects, so that the garbage collector can't remove these objects. I recommend (like Fat Tails already does) to take a plain install and add all the things step by step and check the memory after every step.
The following user says Thank You to Koepisch for this post:
So strange, I rebuilt the workspace from scratch, identically, and find that the leak has disappeared.. the market is very slow right now, perhaps tomorrow when it is moving again it will reappear..... For two days i have been restarting ninjatrader just about on the hour every hour, during the US session, to bring the memory footprint back down to earth, all of a sudden it seems to be normal..
Following this thread mostly because I'll be interested to know what you find (after a few years and a couple of versions of NT I'm still facing similar issues) rather than because I have anything much to add.
In my case, until a couple of weeks ago when I moved NT to a stripped down operating environment it would function normally but with degrading performance until it failed, typically with irreparable database corruption. However, in the latest go-around what initially seemed to be memory management issues with NT turns out to be likely memory management issues with the Windows 7 environment, evidence being NT seems happy as a clam running so far on the bare bones system, absolutely nothing else installed, while the system on which it was previously installed grinds inexorably to a halt due to disappearing memory (leak somewhere unless faulty memory allocation in Windows 7 when challenged is simply the sort of MS product feature we've come to know and love). Some apps deal with disappearing resources more gracefully than others. For me therefore the problem with NT is that a resource-related threshold seems to exist that when exceeded causes NT to shoot itself in the head. For example (as you likely know) when virus checkers lock NT out of files it needs to function it's game over.
While I have come across badly behaved indicators find NT tends to recover when these are removed and to date cannot point to any (including ana- series) or any combination of indicators as being at the root of it. Assume at present some indicators use (modest amounts of) additional memory as time passes possibly because internal structures are holding more data.
The following 2 users say Thank You to bnichols for this post:
Would anybody be able to tell a technically lay person, in easy language, how to monitor NT7 memory usage. I did a clean install of NT7 this morning. I have added two indicators and the momentum bars. I am now monitoring the memory usage and I see that it seems to be moving higher. Is this normal? As new bars come into the chart should NT7's memory footprint rise or should it stay in a level range? What is normal?