question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have some trouble with memory usage.

Example code:

BinanceKline[] binanceKlineList = binanceClient.GetKlines(_pair.ToString(), klineInterval, startTime, null).Data;
binanceKlineList = binanceClient.GetKlines(_pair.ToString(), klineInterval, startTime, null).Data;
binanceKlineList = binanceClient.GetKlines(_pair.ToString(), klineInterval, startTime, null).Data;
binanceKlineList = binanceClient.GetKlines(_pair.ToString(), klineInterval, startTime, null).Data;

Each line, it increases the memory usage dramatically.

Screenshot_1

And i tried to dispose binanceClient object but it didn’t affect memory usage… I tried to wait GC. No… How can I hold it under control? Is it common problem?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JKorfcommented, Sep 9, 2019

Hi, this seems to be an issue in .netcore, a lot of people having issues as seen in the gh issue: https://github.com/aspnet/AspNetCore/issues/1976 If you want a quick work around for the issue you can call garbage collection manually. Something like this keeps the memory usage stable:

            while (true)
            {
                using (var binanceClient = new BinanceClient())
                {
                    var binanceKlineList = binanceClient.GetKlines("BTCUSDT", KlineInterval.FiveMinutes, new DateTime(2000, 01, 01), null).Data;
                    Thread.Sleep(500);
                    GC.Collect();
                }
            }

Other than that, it’s not an issue with this library, so I can’t help you further.

0reactions
JKorfcommented, Sep 9, 2019

With the test project you send using the above code the memory stabilizes around 180mb, it isn’t for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

MEMORY USAGE
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM. The reported...
Read more >
View memory usage in Activity Monitor on Mac
In Activity Monitor, view the amount of system memory being used on your Mac, including physical, compressed, wired, and app memory.
Read more >
How to Check Your Computer's Memory Usage in Windows
To open up Resource Monitor, press Windows Key + R and type resmon into the search box. ... Resource Monitor will tell you...
Read more >
How to free up RAM: 15+ effective methods for Windows ...
Navigate to the “Processes” tab and click the “Memory” header. This will sort all processes from most to least RAM usage.
Read more >
Measure memory usage in your apps - Visual Studio ...
Find memory leaks and inefficient memory while you're debugging with the debugger-integrated Memory Usage diagnostic tool. The Memory Usage tool ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found