Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

CPU and DDR usage limitation in backtesting.

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

    CPU and DDR usage limitation in backtesting.

    Hello. Are the any way to limit the pc resources usage by NT8 during optimization process?

    #2
    Hello Czarek,

    There are not any specific controls on how the platform manages resources in the strategy analyzer. The optimization engine creates many instances of the strategy at once when testing. If you are seeing high memory usage that may be caused by using drawing objects. That can also be caused by other more complex coding scenarios as well.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Currently it creates a thread pool with a number of optimization evaluation threads based on how many virtual cores are available (taking into account CPUs, cores and hyperthreading) and utilizes near 100% of the resources in order to minimize the run time to completion. How are you wanting it to work? Are you wanting some sort of max CPU % across the board? Or to reserve some cores for instance? I think you would have to think through a bit more what it is you are asking them to do because right now they're attempting to do the optimization as quickly as possible and you're asking them not to, basically.

      Also, regarding memory usage (DDR is a particular kind of memory) every .NET program essentially uses all available memory and then initiates garbage collection when necessary. So, memory usage potentially can grow without bound until the .NET Framework decides to initiate garbage collection. It does not generally make sense for NinjaTrader to initiate garbage collection on its own, because generally, in designing such applications, you want the Framework to make these decisions. What that means, in the end, is that NinjaTrader has little control over how much memory is used. Still, if the computer has idle time, the Framework will periodically initiate garbage collection and memory usage will remain steady.

      During optimization, because the CPU is quite busy, the Framework may forestall garbage collection until memory is nearly all used. That is how the Framework is designed. That is not really a problem per se - that's the design - to not waste time collecting the garbage until it is necessary to do so - unless there is free CPU and it has nothing else to do. This design philosophy is to ensure that .NET applications run as fast as possible by not slowing down critical tasks to do garbage collection until they must. Later, when the task is done, if the CPU is idle, the garbage will get collected even if not all the memory has been used. Additionally, if at any point, the memory gets close to being all used, it will do GC even if it's busy with critical tasks because it needs to. That is the design.
      Last edited by QuantKey_Bruce; 05-03-2023, 01:25 PM.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rhyminkevin, Yesterday, 04:58 PM
      5 responses
      62 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Started by realblubb, Today, 09:28 AM
      0 responses
      2 views
      0 likes
      Last Post realblubb  
      Started by AaronKoRn, Yesterday, 09:49 PM
      1 response
      18 views
      0 likes
      Last Post Rikazkhan007  
      Started by ageeholdings, Today, 07:43 AM
      0 responses
      12 views
      0 likes
      Last Post ageeholdings  
      Started by pibrew, Today, 06:37 AM
      0 responses
      4 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Working...
      X