Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
GitHub or 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.
Description of Problem:
The length of the table used to store values in HashSet increases during deserialization. I found that every serialize/deserialize cycle increases the size of the table by around 2.5 times. After a dozen or so times of doing this, the application typically runs out of memory.
Steps to reproduce the problem:
1. Iteratively serialize and deserialize a HashSet with a few items in it
2. Observe the length of the 'table' private field
The length of the table field (and therefore the memory it uses) increases significantly on each serialize/deserialize iteration.
The table should not keep increasing in size.
How often does this happen?
100% of the time the HashSet is deserialized with any items in it.
It looks like not all of the fields are being initialized properly on deserialization, in particular 'threshold' and 'links'.
I'll work on a test case and a pull request.
Created attachment 4661 [details]
Simple program to reproduce the issue
Created a pull request:
Pull request was accepted.