Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tracking Memory usuage

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

    Tracking Memory usuage

    Hello ,

    I am wondering is there anyway I can track what chart or indicator is using memory for Ninjatrader 8. During markets with low volatility I can run my strategies for the entire week without memory issues. However during this week where the market moves suddenly, I notice that the RAM usage for Ninjatrader increases to over 2 GB very quickly in 1 day sometimes.

    I don't believe my software has memory leaks that severe. I have read that I cannot force Garbage collection in NT8 correct?

    #2
    It is expected that your PC resources would increase with higher volatility. The severity of this increase will depend on exactly how you're using NinjaTrader. There is no tool within the platform to specifically track how much RAM each internal process is taking, however, there is a way to track cumulative processing time spent on NinjaScript objects. This tool is called the NinjaScript Utilization Monitor.

    This tool is meant to help identify outliers from the rest of the platform in order to help troubleshoot performance issues.

    Here is some additional documentation on performance issues and tips:

    https://ninjatrader.com/support/help...tallingAdd-Ons

    https://ninjatrader.com/support/help...ance_tips2.htm

    There is now way to force NinjaTrader to 'garbage collect'. This is a Microsoft .NET limitation.

    Comment


      #3
      OK. Thanks. I will use that to help determine what is using up the resources.
      Also one other quick question. The below error states isValidDataPoint issues, however that comes further down the code after:

      if (CurrentBar < 30)
      return;
      Isvalidpoint highest variable is 2. The script will work sometimes without issue and then after X time one of them throws the below error.

      Bar update ERROR ISSystem.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
      Parameter name: index
      at NinjaTrader.NinjaScript.Series`1.IsValidDataPoint( Int32 barsAgo)
      at NinjaTrader.NinjaScript.Indicators.VarianceManual. OnBarUpdate()
      Indicator 'VarianceManual': Error on calling 'OnBarUpdate' method on bar 10334: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
      Strategy 'OrderFlowSingleEQH2018': Error on calling 'EventHandlerBarsUpdate' method: Object reference not set to an instance of an object.

      Comment


        #4
        Hello richa61416,

        Thank you for your response.

        The error alone would only detail that an object is not being set when it is called. Would it be possible to review both the strategy and indicator?

        You can attach the files to your response or send them to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H - 2103911' in the subject line and a reference to this thread in the body of the email.

        You can export your NinjaScript objects by going to Tools > Export > NinjaScript Add On > Add > select your NinjaScript objects > OK > Export > name the file 'NTsupport' > Save.

        The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

        I look forward to assisting you further.

        Comment


          #5
          Sorry not up for sharing the code for those at this moment. The strategy has an indicator that is added using AddChartIndicator. The indicator works fine by itself and never crashes. Only when the strategy uses it, it crashes sporadically so not every day, but when you got the same code in 6 strategies and only one/two crashes it is hard to debug. I will just find away to code around it. Thanks.

          Comment


            #6
            Hello richa61416,

            Thank you for your follow up.

            That is understandable as not everyone is willing to share their proprietary code.

            At the most basic level of the errors seen I would concern myself with accessing values before they are valid. Do you run CurrentBar checks to ensure enough bars are available in the indicator and/or strategy before you accessing a value at a bars index?

            You can find details on ensuring you have enough bars at the following link: https://ninjatrader.com/support/help...nough_bars.htm

            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            63 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            40 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            21 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            23 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            51 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X