System.IndexOutOfRangeException : Index was outside the bounds of the array.

Calling GroupByType on a ObjectSet results in the following exception:

System.IndexOutOfRangeException : Index was outside the bounds of the array.
at JetBrains.dotMemoryUnit.Util.ChunkArray`1.Enumerator.MoveNext()
at JetBrains.dotMemoryUnit.ByTypeGrouping.TypeRestorer.Restore(ChunkArray typesInfo)
at JetBrains.dotMemoryUnit.ObjectSetBase.GetTypeMemoryInfo(MemoryInfoGroupedByType memoryInfoGroupedByType)
at JetBrains.dotMemoryUnit.ObjectSetBase.GroupByType()
at MemoryProfilingExtensions.GetAllocationDeltasForAllTypes(ObjectSet baseObjectSet, ObjectSet newObjectSet)

The exception will disappear if the the size of the object set is decreased using a narrower filter condition. Spliting up the object set into two parts (e.g. by spliting up by namespace) will also make the exception disappearing.

Any help how to get around the exception would be appreciated.

0
6 comments

Lukas,

Could you please save collected data and provide dotMemory workspace to us?

Please call dotMemoryApi.SaveCollectedData() before exception occurs (before calling GroupByType on a ObjectSet). You can find a link to saved workspace in test output.

Please upload .dmw file to our ftp: https://uploads.services.jetbrains.com/

0
Avatar
Permanently deleted user

Hi Anna

I uploaded the dotMemory workspace. The filename is BasicBinauralFittingMemoryLeakTest.2019-05-14T16-37-05.985.dmw.

Btw. in my case, the exception happens when calling GroupByType on an object set created by snapshotDifference.GetSurvivedObjects(Origin.OldSnapshot, query).

Thanks for your support.

0

The issue occurs in some cases if test runner process and dotMemoryUnit.exe process have different ChunkArray size.

It can happen when test is running in x86 process on x64 machine.

Please try to set x64 platform in unit test session options if you use R# unit test runner:

 

Does the exception occur in this case?

 

0
Avatar
Permanently deleted user

When I set the platform to x64 I get the following exception:

Our application supports only x86, so I assume that it is not possible to run it in a 64 bit process, right?

0

Yes, it seems like it's not possible in your case. Please follow this issue in youtrack: https://youtrack.jetbrains.com/issue/DMU-246

You can use filtering to narrow down the size of the object set as a workaround.

Sorry for inconvenience.

0
Avatar
Permanently deleted user

Thanks for the update.

0

Please sign in to leave a comment.