NexusFi: Find Your Edge


Home Menu

 





NT7 custom user code causing memory leak


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one syxforex with 19 posts (3 thanks)
    2. looks_two ThatManFromTexas with 7 posts (1 thanks)
    3. looks_3 Fat Tails with 7 posts (8 thanks)
    4. looks_4 eman with 6 posts (3 thanks)
      Best Posters
    1. looks_one bnichols with 1.5 thanks per post
    2. looks_two Fat Tails with 1.1 thanks per post
    3. looks_3 eman with 0.5 thanks per post
    4. looks_4 syxforex with 0.2 thanks per post
    1. trending_up 16,107 views
    2. thumb_up 19 thanks given
    3. group 8 followers
    1. forum 49 posts
    2. attach_file 1 attachments




 
Search this Thread

NT7 custom user code causing memory leak

  #11 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


syxforex View Post
Thanks for taking a look.

I am at a loss then. I now have my the charts up and running the adxvma keltner channels, channels only, no centre line, no adxvma on in addition to the UKC. There is no memory leak. If I add the anaadxvma with bar paint and plot the memory begins to leak. What else could I look at in my system? I did a fresh install yesterday, only three indicators installed, anavwap, anaadx, and anakeltner Univeral.


thanks again,

-> 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.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Build trailing stop for micro index(s)
Psychology and Money Management
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #12 (permalink)
 eman 
Galveston ,TX
 
Experience: Intermediate
Platform: NT7
Broker: Zaner
Trading: Futures
Posts: 386 since Mar 2010
Thanks Given: 364
Thanks Received: 435


syxforex View Post
Thanks for taking a look.

I am at a loss then. I now have my the charts up and running the adxvma keltner channels, channels only, no centre line, no adxvma on in addition to the UKC. There is no memory leak. If I add the anaadxvma with bar paint and plot the memory begins to leak. What else could I look at in my system? I did a fresh install yesterday, only three indicators installed, anavwap, anaadx, and anakeltner Univeral.


thanks again,

do you happen to have any other custom bar types to test with? i believe @aslan's BetterRenko is one of the more widely used here.

also, what GapSetting are you using with MomentumBars? and are you running fixed-height or dynamic?

cheers,
-e

Reply With Quote
  #13 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
Houston,Tx
 
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,348



syxforex View Post
OK, TMT, sorry to waste your time. I didn't give you the complete setup. In addition to the keltner channel I was using the adxvma separately as the centre line. I thought it was one in the same indicator. It appears there is no memory leak with the adxvma keltners, but the leak may be associate with the adxvma itself, when applied indepently and seaparetly. I am watching now, does not appear to be leaking but will let you update when I know for sure.... thanks again

@syxforex

I added the additional adxvma to each chart.

They have been running for over an hour... no effect.

I think @Fat Tails hit the nail on the head that it may be another indicator you have imported .... even though it is not on your chart.

For this very reason I only keep essential indicators in my NT indicator file.

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
  #14 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518

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.

Reply With Quote
Thanked by:
  #15 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

Thanks a lot TMT,

Well, just trying to reproduce it now..... hmmm the memory poltergeist is not here...





ThatManFromTexas View Post
@syxforex

I added the additional adxvma to each chart.

They have been running for over an hour... no effect.

I think @Fat Tails hit the nail on the head that it may be another indicator you have imported .... even though it is not on your chart.

For this very reason I only keep essential indicators in my NT indicator file.


Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #16 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

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..

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #17 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

Thanks for everybody's help. I will get back to you with more details as I run some more tests...

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #18 (permalink)
 
bnichols's Avatar
 bnichols 
Dartmouth NS
 
Experience: Intermediate
Platform: MC, MC.Net, NT, TWS
Broker: IB / IQFeed / Kids
Trading: Forex, stocks
Posts: 637 since Feb 2010
Thanks Given: 64
Thanks Received: 460

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.

Visit my NexusFi Trade Journal Reply With Quote
  #19 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010

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?

thanks for your assistance

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #20 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
Posts: 1,091 since May 2010


thanks bnichols,

My pc is pretty basic, nt7 and zone alarm anti virus... THATMANFROMTEXAS... do you have antivirus program in background?


bnichols View Post
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.


Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on November 21, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts