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.

This might be more of a question than an issue… anyways:

I’m using RestEase as part of a DotNetCore 2.0 WebAPI to reach out to other rest apis. I love the simplicity but I notice that my API has a memory leak and I traced it back to my usage of Restease.

public class DemoController : Controller
    {
        public ILegacyAPI legacyAPI { get; set; }

        public DemoController(IOptions<AppSettingsServices> options)
        {
            this.legacyAPI = RestClient.For<ILegacyAPI>(options.Value.LegacyAPIBaseUrl);
        }

        public async Task<dynamic> CallOutToOtherAPI()
        {
            var response = await legacyAPI.GetSomethingFromOtherAPI();

            //Do stuff with response and return
        }
    }

Should I be using a scoped rest client maybe? I also saw something about implementing IDisposable?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
canton7commented, Mar 9, 2018

Released as v1.4.5.

1reaction
canton7commented, Mar 9, 2018

Yes, apparently I’m an idiot (at least on a part-time basis). I’ll get that fixed up over lunch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MEMORY USAGE
MEMORY USAGE ... The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in...
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
Check Computer Memory Usage Easily​​ To open up Resource Monitor, press Windows Key + R and type resmon into the search box.
Read more >
How to Free Up RAM and Reduce RAM Usage on Windows
How to Free Up RAM on Your Windows PC: 8 Methods · 1. Restart Your PC · 2. Check RAM Usage With Windows...
Read more >
Measure memory usage in your apps - Visual Studio ...
Find memory leaks and inefficient memory while you're debugging with the debugger-integrated diagnostic 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