NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Suggestions and Feedback > Suggestions And Feedback

Suggestions And Feedback New feature suggestions and feedback.

Reply
 
Thread Tools Display Modes
Old 08-04-2007, 01:48 AM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default Memory Leak?

I believe there is a memory leak issue when loading massive amounts of data. If not a memory leak, at least a memory usage issue. Normally NinjaTrader seems to take about 60-100mb of ram, but when I try to load a years worth of tick and volume data NinjaTrader's memory usage shoots up to 1.5gb+ and crashes shortly after.

When I loaded the years worth of tick data first NinjaTrader's memory usage shot up to 350mbs while it was loading and stayed at 350 after it finished. After the tick data was done I tried to load the years worth of volume bars and then the memory shot to 1gb and as it was downloading/saving it crept up to 1.5gb. At this moment you can probably imagine NinjaTrader being very sluggish with its various windows freezing and the impending crash.

This was experienced with a barebones workspace of NinjaTrader. Just the Control Center and one chart for Tick bars and one chart for Volume bars.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-04-2007, 05:02 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

This is not unexpected, since a year of tick data is a lot. This is not a memory leak but just the memory usage to load all the data. I would be quite surprised if it worked, though.

Quick math:
- 150.000 ticks per day on ES
- 200 trading days
- ~25 bytes per tick

-> 750 MB not counting additional overhead
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-04-2007, 10:53 AM   #3
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Gotcha. Maybe it would be beneficial to NinjaTrader's performance/"lightweightedness" if it could read the data from the database on as it is needed instead of trying to store the whole thing in ram.

Just a little side note. It seems loading a year of tick data is manageable at ~400-600mbs of ram, but the killer is loading volume data. I tried to load volume for 30 days and just that busted 1.5gb of ram and crashed. 20 days of volume data loads fine with only ~300mb of ram though. NinjaTrader also doesn't seem to release the resources after I close the massive charts. After loading 20 days of volume the mem usage hovers at ~300mb until I restart Ninja.
NinjaTrader_Josh is offline  
Reply With Quote
Old 08-04-2007, 04:30 PM   #4
Gumphrie
Senior Member
 
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
Default

Agreed, I sometimes have similar problems if I have too many charts open and initiate a data feed connection.

Can't it be a bit more clever by junting stuff into disk space? I hate seeing those data popups that never close and don't tell you anything. Just end up having to restart Ninja.
Gumphrie is offline  
Reply With Quote
Old 08-05-2007, 04:07 AM   #5
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> I tried to load volume for 30 days and just that busted 1.5gb of ram and crashed
We'll look into that.

>> I hate seeing those data popups that never close and don't tell you anything
This issue is not related. You'll see this popup as NT loads data from your provider. NT always loads data from your provider e.g. on the current day to not leave you with gaps.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-05-2007, 06:56 AM   #6
Gumphrie
Senior Member
 
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
>> I hate seeing those data popups that never close and don't tell you anything
This issue is not related. You'll see this popup as NT loads data from your provider. NT always loads data from your provider e.g. on the current day to not leave you with gaps.

Yes, but they should go away and not stay around forever (with the abort button greyed out).
Gumphrie is offline  
Reply With Quote
Old 08-05-2007, 10:16 PM   #7
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

- can you reproduce at will?
- what provider is that?
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-06-2007, 12:52 AM   #8
Gumphrie
Senior Member
 
Join Date: Jun 2007
Posts: 218
Thanks: 0
Thanked 1 time in 1 post
Default

I believe I have seen it on various data feeds, but the most consistent is AMP/Zen-Fire after you have many graphs open when you reconect. The 'Abort' button is always greyed out with them, so if the data doesn't come back there is no way to get rid of the popup except by restarting Ninja.
Gumphrie is offline  
Reply With Quote
Old 08-06-2007, 04:05 AM   #9
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

You will see the Abort button greyed out on those feeds where an abort option is not supported. The button will be active on those feeds where abort would be supported.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-06-2007, 12:13 PM   #10
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Quote:
Originally Posted by uacvax View Post
Gotcha. Maybe it would be beneficial to NinjaTrader's performance/"lightweightedness" if it could read the data from the database on as it is needed instead of trying to store the whole thing in ram.

Just a little side note. It seems loading a year of tick data is manageable at ~400-600mbs of ram, but the killer is loading volume data. I tried to load volume for 30 days and just that busted 1.5gb of ram and crashed. 20 days of volume data loads fine with only ~300mb of ram though. NinjaTrader also doesn't seem to release the resources after I close the massive charts. After loading 20 days of volume the mem usage hovers at ~300mb until I restart Ninja.
Thanks for providing the background info by PM. Here is the problem:
- volume bars even eat up more space than ticks bars, since they have not only one double value (open) but high/low/close too + 24 additional bytes
- going with volume 150 on a stock like AAPL even will "split" up e.g. a 1500 shares tick into 10 additional volume bars

-> the memory excess risk on 150 volume bars on stocks is much higher than just with tick bars

However: The next release will trap the exceptions you experienced and provide a meaningful error message.

Also: .NET 2.0 is a garbage collection system, meaning although NT properly release memory, you will not see an immediate decrease of memory footprint on task manager, since the .NET runtime could decide to keep this freed memory under its management. There is no way an application could control that.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 08-06-2007, 12:36 PM   #11
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Thanks for the explanations Dierk. I guess I'll just have to restrain myself from the urge to load astronomical amounts of data all at once.
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Walk Forward Out of Memory Message daven Strategy Analyzer 1 06-01-2007 11:03 AM
ninjatrader memory handling and optimization scriabinop23 Miscellaneous Support 10 05-22-2007 11:46 AM
Memory Buildup Alfred Miscellaneous Support 1 08-08-2006 06:14 AM
Chart Screen Position Memory Alfred Charting 6 06-22-2006 06:51 AM
Ninja Needs ~ Performance Memory CashFlow Suggestions And Feedback 0 01-25-2006 02:37 PM


All times are GMT -6. The time now is 04:38 PM.