Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Default gcAllowVeryLargeObjects to true #8853

Merged
merged 2 commits into from
Jan 10, 2017
Merged

Conversation

mikedn
Copy link

@mikedn mikedn commented Jan 9, 2017

It seems to me that this option should be enabled by default in a new framework such as .NET Core.

The only reason I can think of why one might want to disable this option is poorly written unsafe code that assumes that objects can't be larger than 2GB and thus offsets can be represented using int. Any compat concerns?

Fixes #8847

@jkotas
Copy link
Member

jkotas commented Jan 9, 2017

@Maoni0 Could you please take a look as well?

@jkotas
Copy link
Member

jkotas commented Jan 9, 2017

@mikedn There are a few failing tests - they may need updating:

JIT._jit64_regress_vsw_539509_test1_test1
JIT._Regression_VS_ia64_JIT_V2_0_RTM_b539509_b539509_b539509

@mikedn
Copy link
Author

mikedn commented Jan 9, 2017

@jkotas Yep, those tests were expecting an OutOfMemoryException to be thrown. I increase the array length so they always get the expected exception due to array length being limited to 2^31.

PS Great, now formatting jobs fail :)

@sbomer
Copy link
Member

sbomer commented Jan 9, 2017

@dotnet-bot test Ubuntu x64 Formatting please
@dotnet-bot test Windows_NT x64 Formatting

@sbomer
Copy link
Member

sbomer commented Jan 9, 2017

FYI, the formatting job failure should be fixed.

@Maoni0
Copy link
Member

Maoni0 commented Jan 9, 2017

fine by me.

@jkotas
Copy link
Member

jkotas commented Jan 9, 2017

@mikedn The tests are still failing. Do they pass for you locally?

Thank you for fixing this!

@mikedn
Copy link
Author

mikedn commented Jan 9, 2017

@jkotas They passed before checkin. Now that I increased my pagefile size they fail too. I didn't realize that MD arrays can actually have more than 2 billion elements, back to the drawing board.

These 2 tests appear to rely on gcAllowVeryLargeObjects being false in that they expect an exception to be thrown when allocating a very large array.

Increase the number of array elements so that an OutOfMemoryException is always thown no matter what value gcAllowVeryLargeObjects has. 81*98*58*36*74*4 is 4906065024 which is larger than 2^32, the theoretical array length limit.
@mikedn
Copy link
Author

mikedn commented Jan 9, 2017

Yep, MD arrays can have up to 4 billion elements, updated tests accordingly.

@jkotas jkotas merged commit 163983e into dotnet:master Jan 10, 2017
manofstick pushed a commit to manofstick/coreclr that referenced this pull request Jan 16, 2017
* Default gcAllowVeryLargeObjects to true

* Update tests for gcAllowVeryLargeObjects

These 2 tests appear to rely on gcAllowVeryLargeObjects being false in that they expect an exception to be thrown when allocating a very large array.

Increase the number of array elements so that an OutOfMemoryException is always thown no matter what value gcAllowVeryLargeObjects has. 81*98*58*36*74*4 is 4906065024 which is larger than 2^32, the theoretical array length limit.
@mikedn mikedn deleted the large-obj branch April 10, 2017 05:45
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Default gcAllowVeryLargeObjects to true

* Update tests for gcAllowVeryLargeObjects

These 2 tests appear to rely on gcAllowVeryLargeObjects being false in that they expect an exception to be thrown when allocating a very large array.

Increase the number of array elements so that an OutOfMemoryException is always thown no matter what value gcAllowVeryLargeObjects has. 81*98*58*36*74*4 is 4906065024 which is larger than 2^32, the theoretical array length limit.

Commit migrated from dotnet/coreclr@163983e
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants