Skip to content

High memory usage when doing a RetrieveMultiple for 4 minutes #305

@Ivan-Colomer

Description

@Ivan-Colomer

Hi!

I'm trying to figure out why is there a high memory usage peak that lasts for 4 minutes when doing RetrieveMultiple.

There's a LOH memory usage of 400MB (approx) that disappears after 4 minutes. See image 1 (before) and image 2 (after):
1

2

I've done a Snapshot to see what's actually going on with the memory usage and I've found out that there are 385MB of Byte[] that is somehow stucked there for those 4 minutes (see image 3 and image 4).
3

4

What the program does is using RetrieveMultiple with PagingInfo to retrieve 30.173 records by pages of size 5.000 records. That's why there are 6 Byte[] of size 60MB (approx). So I'm guessing these LOH objects stored there for 4 minutes are the responses from those queries.

I've checked the code around these lines and I haven't seen any Dispose() on the HttpResponseMessage:

var json = await sResp.Content.ReadAsStringAsync().ConfigureAwait(false);

Wouldn't it be necessary in order to tell the GC that the memory allocated for it can be released?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions