Bug 44102 - Memory consumption constantly increasing
Summary: Memory consumption constantly increasing
Alias: None
Product: Profiler
Classification: Xamarin
Component: Android ()
Version: 0.34.x
Hardware: PC Windows
: Normal normal
Target Milestone: (C8)
Assignee: Jose Miguel Torres
Depends on:
Reported: 2016-09-08 06:48 UTC by toSilence
Modified: 2016-11-07 12:13 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Profiler screenshot (125.26 KB, image/png)
2016-09-08 06:48 UTC, toSilence
Snapshot screenshot (51.06 KB, image/png)
2016-09-13 07:39 UTC, toSilence
Index was out of range. Parameter name: chunkLength (10.31 KB, text/plain)
2016-09-14 08:14 UTC, toSilence

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description toSilence 2016-09-08 06:48:05 UTC
Created attachment 17373 [details]
Profiler screenshot


I think it's the same bug as this one: https://bugzilla.xamarin.com/show_bug.cgi?id=27253

We tried to profile our app and recognized that the number of strings were increasing about 9000 per touch.
So we assumed that something is going wrong.

But as we searched the web we found bug reports about the profiler.

Best Regards
Comment 1 Rodrigo Moya 2016-09-08 12:34:53 UTC
Looking at the screenshot, there are some small drops in the chart, so it's not constantly increasing AFAICS. So, from the screenshot, it looks like normal behavior. The chart displays the memory being used at an time by your application, so if the app doesn't allocate new memory, it doesn't grow.

So, what happens if you make your application open a second screen, for instance, allocate a lot of temporary memory, and then close the screen? How does the chart look like in that case?

There's a bug though in the chart it seems, see at the end, there seems to be some "loop" there when drawing the points.
Comment 2 toSilence 2016-09-08 12:46:23 UTC

ok, you are checking the chart.

I'm talking about the 1.215.898 strings with 72 MB size in the Allocations at place 1.

The number is growing per touch about 9000 times.

And I think this is related to the bug which is already marked as solved:


Best Regards
Comment 3 Rodrigo Moya 2016-09-08 15:17:13 UTC
Ah yes, that list shows the total number/size of objects allocated by your application. If you want to see what's still alive, take a snapshot (click the camera icon on the toolbar) and then filter the list by selecting 'Only persistent objects' on the right side panel. That would show only the objects that were present when you took the last snapshot.
Comment 4 toSilence 2016-09-13 07:39:02 UTC
Created attachment 17435 [details]
Snapshot screenshot
Comment 5 toSilence 2016-09-13 07:39:24 UTC

I don't know exactly how snapshots work.
When I press the snapshot button my app is freezing and not handling user input anymore.
A snapshot is not created in your tool it just says reading data.
Comment 6 Rodrigo Moya 2016-09-13 12:14:48 UTC
Ok, that's because of a bug in xamarin.android that is already fixed. If possible, please update to Cycle 8 (that is, the beta channel in XS updater), which includes that and lots of other profiler fixes.

Let me know how it goes, and we'll see if there's still any bug left.
Comment 7 toSilence 2016-09-14 07:06:09 UTC
I updated to the version 0.34.1 which was released on 2016-09-12.
The profiler is stopping immediately after the app is started.

The error in the log file is:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: chunkLength
Comment 8 Rodrigo Moya 2016-09-14 07:54:54 UTC
Can you please provide the profiler logs (~/Library/Logs/Xamarin.Profiler)?
Comment 9 toSilence 2016-09-14 08:14:43 UTC
Created attachment 17457 [details]
Index was out of range. Parameter name: chunkLength
Comment 10 Rodrigo Moya 2016-11-07 12:13:37 UTC
This bug is already fixed in 0.38.0