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

NT8 Lightweight - Script to Collect Garbage or Cache clearing

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

    NT8 Lightweight - Script to Collect Garbage or Cache clearing

    Hi
    I am looking to find out if it is possible to collect garbage to free memory, or free up any cache or some similar sort to ensure a lightweight application running at any given time. Other than clearing the /db/ folder what else that could cleared?

    If so, could a script be written to achieve so?

    The reason for my post is that I feel NT8 slows down after running for some time have to restart, have to clear the /db/ folder. After some time for a given workspace its slows down further, have to clear a duplicate WorkSpace or rename helps somewhat. Eventually after some time have NT8 is slow anyhow, and have to uninstall and re-install the whole application, and its a pain to bring back everything back to its intended settings etc.

    I am looking to hire a programmer if such a case.

    Tariq Rasheeduddin-

    #2
    Hello Tariq,

    Cache is intended to provide precalculated information so the platform does not have to calculate it again. It is designed to speed up the platform and would not be something we would recommend clearing unless there is a technical issue involving the data on your platform.

    I do not think the cache is the source of your troubles here. Generally long platform start up times are attributed to how much we are loading on the platforms start up. The questions below can help to get a better idea on how platform startup is being impacted.
    • How many charts do you have in your workspace?
    • Do you have multiple tabs in each chart?
    • Do any of your charts have Tick Replay enabled?
    • How much data is being loaded with each chart?
    • How many indicators are involved in your workspace? Are any of these resource intensive?
    If you are having technical issues with your workspace after taking in mind the above, you could email it to us and we can test it on our end. We would not be able to test any third party components, as we would not have them, but we could offer our insight and we can also return a copy that does not have the third party components added. This can help to determine if one of these components is contributing to the long start up times after some time.

    We look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Please see my response below:

      First off, there are number of 3rd party script for indicators and couple of Application Package from NOFT (NOFT IES & Tracker). Please see attached excel spreadsheet for all the details.
      • How many charts do you have in your workspaces (8 Charts - please see attached spreadsheet for details)
      • Do you have multiple tabs in each chart? (Single Tabs each Chart)
      • Do any of your charts have Tick Replay enabled? (No)
      • How much data is being loaded with each chart? (From 1 day to 7 days depending on each chart - please see attached spreadsheet for details)
      • How many indicators are involved in your workspace? Are any of these resource intensive? (please see attached spreadsheet for details)
      As far as recreating the scenario, NOFT has already tested on their end regarding their package, works fine on their end.

      What I am really looking forward is a recommendation for any garbage collection / memory leakage prevention techniques or any other data built-up that could cause this slowness with time. The reason being after a real fresh install things are pretty smooth and fast, and with time it slows down. Its quite a hassle to reinstall everything from scratch every weekend.

      Please see this OnRender() thread for reference if this is something going to help for any pointers along?


      Best regards,
      Tariq

      Comment


        #4
        Hello Tariq,

        .NET performs garbage collection on its own. There really would not be a way we could advise to free resources manually other than closing and reopening the platform, and we also would not recommend clearing cache as a regular maintenance step. I could see this causing additional issues with the platform if one tried to automate this in a script.

        The NinjaTrader platform can use a lot of memory and OrderFlow and Volume Profile indicators are also compute intensive. I would suggest saving a reduced workspace with your 3rd party components removed and then to switch to this workspace when you are closing NinjaTrader. Please ensure all other workspaces are closed before you close the platform. This way, the platform will always start with a leaner workspace. We should not see start up issues with this reduced workspace, and it would be indicative that a component in that workspace is taking some time to load.

        As I also mentioned in post #1, If you would like to send us a copy of your workspace, we can return a copy without any third party components included and that can be used with the above test to better determine what is impacting platform startup times.

        The thread you have linked is where I have discussed managing SharpDX resources. Improper use of SharpDX resources can cause memory leaks, but this is not something that can be resolved by an external script, the code doing the custom rendering will need to use SharpDX resources appropriately and dispose them either at the end of an OnRender pass if created in OnRender, or disposed and recreated in OnRenderTargetChange if the resource should be re-used.

        I look forward to being of further assistance.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Yesterday, 05:46 PM
        3 responses
        23 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        22 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X