summaryrefslogtreecommitdiff
path: root/src/gc/gcinterface.h
AgeCommit message (Collapse)AuthorFilesLines
2019-07-08Return HardLimitBytes from GCMemoryInfo.TotalAvailableMemoryBytes (#25437)Andy Hanson1-5/+6
* Add property HardLimitBytes to GCMemoryInfo This adds a new property HardLimitBytes. Unlike TotalAvailableMemoryBytes, this will reflect an explicitly set COMPLUS_GCHeapHardLimit. It will also reflect the fraction of a container's size that we use, where TotalAvailableMemoryBytes is the total container size. Normally, though, it is equal to TotalAvailableMemoryBytes. Fix #38821 * Remove HardLimitBytes; have TotalAvailableMemoryBytes take on its behavior * Fix typos * Separate total_physical_mem and heap_hard_limit so we can compute highMemoryLoadThresholdBytes and memoryLoadBytes * Do more work in gc.cpp instead of Gc.cs * Consistently end names in "Bytes"
2019-05-24Add more runtime GC counters (#24561)Sung Yoon Whang1-0/+4
* Add Series/CounterType to CounterPayload and IncrementingCounterPayload * merging with master * Add Generation sizes counter * Some cleanup * Add allocation rate counter * Fix build * add Allocation Rate runtime counter * Fix a potential div by zero exception * Add back in code commented out * Add LOH size counter * Fix linux build * GetTotalAllocated -> GetTotalAllocation * PR feedback * More cleanup + renaming per PR feedback * undo comments * more pr feedback * Use existing GC.GetTotalAllocatedBytes API instead * Remove duplicate GetTotalAllocation * More PR feedback * Fix x86 build * Match type between C++/C# * remove unused variables'
2019-05-15Remove concept of AppDomains from the GC (#24536)David Wrighton1-25/+3
* Remove concept of AppDomains from the GC - Leave constructs allowing for multiple handle tables, as scenarios for that have been proposed - Remove FEATURE_APPDOMAIN_RESOURCE_MONITORING
2019-05-13Implement GC.GetTotalAllocatedBytes (#23852)Ludovic Henry1-0/+2
* keep what's allocated so far on each heap * Implement GC.GetTotalAllocatedBytes It is based on https://github.com/dotnet/corefx/issues/34631 and https://github.com/dotnet/corefx/issues/30644 * Fixing races related to dead_threads_non_alloc_bytes * separated per-heap SOH and LOH counters. Different locks imply that we need different counters. * allow/ignore torn 64bit reads on 32bit in imprecise mode. * PR feedback * simplified the test a little to avoid OOM on ARM
2019-05-02System.GC.AllocateUninitializedArray (#24096)Vladimir Sadov1-4/+24
* Do not expand to allocation_quantum in SOH when GC_ALLOC_ZEROING_OPTIONAL * short-circuit short arrays to use `new T[size]` * Clean syncblock of large-aligned objects on ARM32 * specialize single-dimensional path AllocateSzArray * Unit tests * Some PR feedback. Made AllocateUninitializedArray not be trimmed away. * PR feedback on gchelpers - replaced use of multiple bool parameters with flags enum - merged some methods with nearly identical implementation - switched callers to use AllocateSzArray vs. AllocateArrayEx where appropriate. * PR feedback. Removed X86 specific array/string allocation helpers.
2019-04-24Add Medium GC Profiling Mode & ICorProfilerInfo::GetObjectReferences (#24156)Mukul Sabharwal1-0/+4
2019-04-11Remove duplicates. (#23922)bdebaere1-2/+0
2019-03-07Fix how we check whether events are enabled via LTTng (#22707)Sung Yoon Whang1-0/+10
* Fix how we check whether events are enabled via LTTng * Add GCToEEInterface::UpdateGCEventStatus * Fix build errors * Finished hooking it up to post_gc * Some comments about the event keyword/level detection logic * Fix windows build * Fix Prv provider keyword logic * forgot to add one more ifdef * Fix OSX build * one more ifdef to fix * Addressing PR feedback * Update GCEventStatus at gc_heap::initialize_gc too
2019-02-22Enable FEATURE_BASICFREEZE (#22776)Mukul Sabharwal1-0/+3
2019-02-21increasing LocalGC version to 3 for 3.0 (#22751)Maoni Stephens1-1/+1
2018-12-26desktop port (#21523)Maoni Stephens1-2/+2
+alloc lock split into SOH and LOH +provisional mode to fix too many gen2 GCs triggered in low mem situation when the heap has heavy pinning fragmentation +better free list usage +premature OOM fixes +3 new configs: GCHeapAffinitizeMask, GCHighMemPercent, GCLOHThreshold (will be documented) YieldProcessor scaling factor is different on core due to the different implementation on core.
2018-08-31Enable gc_profiling for local gc (#19777)David Mason1-11/+1
2018-08-25Remove NumaNodeInfo, CPUGroupInfo, AppDomain, SystemDomain, and EEConfig ↵David Mason1-1/+1
stubs from local gc (#19500) * Switch NumaNodeInfo and CPUGroupInfo to the interface * Remove AppDomain/SystemDomain stubs * remove EEConfig methods * Port numa code to the coreclr side * add numa back to PAL and standalone builds * enable numa for PAL/Standalone builds, and fix BOOL warnings * remove unused defines, and fix linux build errors * building on windows * about to delete numa work from unix and want a backup * add stubs for unix numa/cpugroup * Code review feedback * Code review feedback
2018-06-09Avoid NativeOverlapped pinning by allocating unmanaged memory for it (#18360)Jan Kotas1-1/+1
It makes PinnableBufferCache unnecessary
2018-04-02[local gc] gc spinning part 1 (#17341)David Mason1-0/+3
Add an api so the VM can tell the GC how long to spin for to normalize across processor families.
2018-04-02Added a new API to provide memory information that GC records. This (#17326)Maoni Stephens1-0/+14
is to be used by BCL for deciding when to trim memory usage in pooling code
2018-03-27fix for logalways eventing level (#17277)David Mason1-1/+2
2018-03-13[local gc] refactor apis for threading and suspension to avoid redundant ↵David Mason1-0/+3
calls in to the runtime (#16765) * [Local GC] Refactor calls involving thread modes, suspension, and alloc contexts to always operate on current thread * BOOL -> bool for enable/disable preemptive routines, also remove an unused call to GetThread * avoid one indirection by having GCToEEInterface::EnablePreemptiveGC return a bool indicating whether the mode was changed * Callback on IGCHeap for the runtime to notify the GC when it is trapping threads * use g_fSuspensionPending instead of GCToEEInterface::CatchAtSafePoint for allow_fgc * Remove CatchAtSafePoint * Remove GetThread from WaitLongerNoInstru * code review feedback * code review feedback * change BOOL to bool
2018-02-01Memory footprint gc latency level (#15469)gbalykov1-3/+0
Starting the work on latency levels Current tuning is latency_level_balanced Added the latency_level_memory_footprint level for optimizing for memory footprint
2018-01-31[local gc] Enable eventing (#16120)David Mason1-3/+3
* move GC etw enums to gcinterface.ee.h * add GetActiveSyncBlockCount * refactor reference to ETW::GCLog::ShouldTrackMovementForEtw() * mov g_dwHandles to gc side * enable FEATURE_EVENT_TRACE for gc
2018-01-26GCPrivate, GCHandle, and GChandlePrivate events for local GC (#16020)David Mason1-0/+6
* first event changed * rest of the private events * whitespace fixes
2018-01-23[Local GC] FEATURE_EVENT_TRACE 1/n: Tracking Event State (#15873)Sean Gillespie1-0/+50
* [Local GC] FEATURE_EVENT_TRACE 1/n: Add infrastructure for keeping event state within the GC and plumbing to communicate event state changes * Code review feedback: use a load without a barrier in IsEnabled and put debug-only code under TRACE_GC_EVENT_STATE * Address code review feedback: add EventPipe callback and comments * Fix the non-FEATURE_PAL build * Fix an issue where the GC fails to react to ETW callbacks to occur before the GC is initialized (e.g. on startup when an ETW session is already active) * Simplify callback locking scheme * Add a separate callback for each EventPipe provider and funnel them all through a common handler * Fix non-FEATURE_PAL build
2018-01-21Remove AppDomainLeaks configuration option (#15956)antofik1-2/+2
Removed all usages of AppDomainLeaks configuration option and CHECK_APP_DOMAIN_LEAKS feature Fix #12094
2017-12-13Revert " Revert "[Local GC] Move knowledge of overlapped I/O objects to the ↵Jan Kotas1-11/+20
EE through four callbacks (#14982)""
2017-12-12Revert "[Local GC] Move knowledge of overlapped I/O objects to the EE ↵Sean Gillespie1-20/+11
through four callbacks (#14982)" This reverts commit c755e3b7f5d597c8d192675dbaaa337268d93f1c.
2017-11-27[Local GC] Move knowledge of overlapped I/O objects to the EE through four ↵Sean Gillespie1-11/+20
callbacks (#14982) * [Local GC] Move knowledge of overlapped I/O objects to the EE through four callbacks * Code review feedback: 1. Rename OverlappedData->AsyncPinned in interface methods 2. Remove additional FEATURE_REDHAWK defines around async pin relocation code * Eliminate two GCToEEInterface callbacks by passing the callbacks directly as arguments to a method on IGCHandleStore * Repair clang build * Split pin and async pin handle scans into two separate callbacks * Fix the clang and non-Windows builds
2017-11-01[Local GC] Fix (another) ScanContext layout issue when building without ↵Sean Gillespie1-2/+0
FEATURE_REDHAWK (#14777)
2017-10-30[Local GC] Fix an issue where the size of ScanContext differs between EE and ↵Sean Gillespie1-0/+6
GC (#14747)
2017-10-27[Local GC] Implement loader protocol for a standalone GC (#14663)Sean Gillespie1-14/+29
* First cut of the load protocol * Implement for non-standalone GC * Initial working implementation * First steps towards not using GetProcAddress when not using a standalone GC * Factor out loading routines into standalone and non-standalone cases * Remove the FEATURE_STANDALONE_GC_ONLY build * Code cleanup and comments * Comments for the version numbers * Use more appropriate type for config string * add GC_LOAD_STATUS_BEFORE_START to disambiguate failures before the start of the load and failures at the beginning of the load * FEATURE_STANDALONE_GC on by default * Implement YieldProcessor and MemoryBarrier for arm and arm64 * Remove missed FEATURE_STANDALONE_GC feature check
2017-08-22[Local GC] Enable building the GC as a shared library (#13137)Sean Gillespie1-0/+3
* [Local GC] Build the GC using system headers * Disable features to get the GC to build * Get rid of the separate 'GC PAL' build * Remove unused stuff * Don't build gcenv.os.cpp when linking in a standalone gc * Stub out CPUGroupInfo and NumaNodeInfo * Stub out IsGCThread and friends * Build the GC as a shared library :tada: * Build, link, and run! :tada: * Fix standalone GC build break * Fixes where the GC's MethodTable and VM's MethodTable classes disagree * Integrate a standalone GC into the CoreCLR build system (so it gets copied to the output folder). Re-enable some ifdef-ed out includes that are required for a non-standalone build of the GC. * Bring changes to Unix and fix the Unix build. Implement some compiler intrinsic wrappers and alignment functions expected by the GC. * Fix the Windows build * 1. Code review feedback: use standard types for BitScanForward and BitScanForward64 2. Delete FEATURE_COM stuff from the build system, not needed for this PR 3. Fix the Unix build * Fix the Windows x86 build - the _BitScanForward64 intrinsic is not available when targeting 32-bit platforms * Remove a number of things from gcenv.base.h that are not used * Remove a linker workaround now that we are not linking a standalone GC into the runtime * Remove dead code, make the lack of GC_PROFILING for standalone gc not break profiling on the non-standalone build * Code review feedback - use add_library_clr and other cmake-related fixes * Fix include indentation * Remove some extraneous parameters to cmake functions (cmake is remarkably lenient...)
2017-06-23[Local GC] Remove a number of inclusions of handle table private headers ↵Sean Gillespie1-0/+10
from the VM (#12389) * Remove inclusions of private handle table headers from the VM * Add TraceRefCountedHandles to the GC handle table interface * Fix the Unix build * Move ValidatePinnedObject to marshalnative.h
2017-06-15[Local GC] Fix a number of handle table interface violations (#12277)Sean Gillespie1-5/+9
* Fix a smattering of GC handle table interface violations Stub out a few other handle violations * [Local GC] Add SetExtraInfoForHandle onto GC handle manager interface * [Local GC] Changes uses of HndGetHandleADIndex to GetHandleContext * Add HandleGetType to GC handle table interface 1) Change IGCHandleManager methods that take "int" to represent the type of a handle to HandleType, and fix callers to cast to HandleType 2) Add HandleFetchType to IGCHandleManager, returning a HandleType 3) Fix uses of handtablepriv's HandleFetchType and remove the GC directory from the include path * 9 -> HNDTYPE_WEAK_WINRT, 0 -> HNDTYPE_WEAK_SHORT in assert
2017-06-01[Local GC] Obtaining configuration information (#11379)Sean Gillespie1-6/+0
* [Local GC] Skeleton for GC configuration * Initial tweaks after design feedback: 1) Use string keys instead of enums. Upon receiving a string key, the EE looks at it and, if it's something that comes from startup flags, responds using the startup flag information. Otherwise, it forwards the string onto CLRConfig. 2) Add a mechanism for getting string configuration values from the EE. This includes adding a RAII wrapper around strings so that they are freed correctly. * Remove uses of g_pConfig from the GC and replace with GCConfig * Use the GCConfig system for the GC log * Fix poorly-named parameter * Add documentation and caching of bool and int configs obtained from the EE * Remove AppDomainLeaks as dead code * Remove GC trace configs as dead code * Repair unix build * Fix an issue where we started the GC in the wrong latency mode * Fix the unix build * Pipe GCRetainVM configuration to the GC * Dead code removal in the GC sample * EEConfig -> GCConfig for heap verification constants in the GC * Populate config information for bools and ints eagerly at startup * Initialize g_theGCToCLR before initializing GCConfig * Propegate HoardVM config to the GC * Fix an incorrect comment
2017-06-01[Local GC] Add async pinned handle methods to the handle interface (#11569)Sean Gillespie1-0/+5
* [Local GC] Add async pinned handle methods to the handle interface * Add a callback to HandleAsyncPinnedHandles for handle enumeration * Rename HandleAsyncPinnedHandles -> EnumerateAsyncPinnedHandles * Introduce typedef for function pointer type
2017-06-01[Local GC] Fix some handle table interface violations in COMDependentHandle ↵Sean Gillespie1-0/+4
(#11358)
2017-06-01[Local GC] Scaffolding for loading a standalone GC (#11242)Sean Gillespie1-5/+14
* Configure the build system to build a CoreCLR capable of loading a standalone GC * Proto-implementation of dynamic GC loading * Build the GC with the VM's CMakeLists when doing a non-standalone build of the GC * [Local GC] Introduce a new feature define, FEATURE_STANDALONE_GC_ONLY, to be used by the CI to explicitly test local GC dynamic loading code paths * Fix the FEATURE_STANDALONE_GC_ONLY build for unix linkers * Rebase against master * Code review feedback: use the existing Unix exports file
2017-04-20Rename CompareAndSwap to InterlockedCompareExchange.Aditya Mandaleeka1-1/+1
2017-04-17Move handle manipulation functions to interface.Aditya Mandaleeka1-0/+6
2017-04-14Merge pull request #10955 from adityamandaleeka/makeHandleStoreClassAditya Mandaleeka1-15/+21
Make a GCHandleStore class and interface for use by the VM
2017-04-14[Local GC] Move operations on CLREventStatic to the EE interface (#10813)Sean Gillespie1-3/+5
* [Local GC] Move operations on CLREventStatic to the EE and add their functionality to the interface * Fix a missed case * Split GetWaitForGCEvent into two smaller interface methods to avoid exposing the event itself on the interface * Initial implementation for Unix * Complete unix implementation * Make it work on Windows * Remove redudant methods from GCToEEInterface * Fix the Linux build * First part of code review feedback: make GCEvent dispatch statically (Windows) * Second part of code review feedback: make GCEvent dispatch statically (Unix) * Standardize implementation across Windows/Unix (apparently MSVC is more lenient about constructor names than clang) * Address code review feedback: Add Create*Event methods back onto GCEvent and remove them from GCToOSInterface * Address code review feedback: remove a dead define * Remove a bad comment, remove an unnecessary friend class, fix some formatting issues * Fix an issue when initializing a GCEvent on Linux (should not be allocating an Impl in the constructor) * Fix the same issue on Windows (less bad, just leaks memory instead of asserting)
2017-04-13Rename IGCHandleTable to IGCHandleManager.Aditya Mandaleeka1-3/+3
2017-04-13Make a GCHandleStore class and interface for use by the VM.Aditya Mandaleeka1-13/+19
2017-04-11Rename overloaded "table" to "store" for VM side concept.Aditya Mandaleeka1-9/+9
2017-04-11Hide knowledge of handle table buckets and home heaps from VM side.Aditya Mandaleeka1-0/+8
2017-04-11Add GetNewHandleTable and GetGlobalHandleTable to interface.Aditya Mandaleeka1-0/+4
2017-04-11Remove GetHandleTableForHandle and add CreateDuplicateHandle.Aditya Mandaleeka1-2/+2
2017-04-11Replace GetHandleTableContext with GetHandleContext.Aditya Mandaleeka1-1/+1
2017-04-10Move handle destruction code to IGCHandleTable.Aditya Mandaleeka1-0/+6
Conflicts: src/vm/gchandletableutilities.h
2017-04-07Merge pull request #10757 from adityamandaleeka/handle_table_local_gc_initAditya Mandaleeka1-0/+20
[Local GC] Move handle creation to IGCHandleTable
2017-04-07Move OBJECTHANDLE definition to gcinterface.hAditya Mandaleeka1-0/+12