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!
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
NinjaTrader
CPU and DDR usage limitation in backtesting.
Collapse
X
-
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
-
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.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by strategist007, Today, 07:51 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,967 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
55 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
6 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
Comment