- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 37 for setGCPercent (0.17 sec)
-
src/runtime/debug/garbage_test.go
old := SetGCPercent(123) new := SetGCPercent(old) if new != 123 { t.Errorf("SetGCPercent(123); SetGCPercent(x) = %d, want 123", new) } // Test that the percentage is implemented correctly. defer func() { SetGCPercent(old) setGCPercentBallast, setGCPercentSink = nil, nil }() SetGCPercent(100) runtime.GC() // Create 100 MB of live heap as a baseline.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 19 14:30:00 UTC 2023 - 7.2K bytes - Viewed (0) -
src/cmd/cgo/internal/test/issue9400_linux.go
for i := range big { big[i] = pattern } // Disable GC for the duration of the test. // This avoids a potential GC deadlock when spinning in uninterruptible ASM below #49695. defer debug.SetGCPercent(debug.SetGCPercent(-1)) // SetGCPercent waits until the mark phase is over, but the runtime // also preempts at the start of the sweep phase, so make sure that's // done too. See #49695. runtime.GC()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jul 18 19:55:29 UTC 2023 - 1.7K bytes - Viewed (0) -
src/runtime/testdata/testprogcgo/stackswitch.go
func stackSwitchCallback() { // We want to trigger a bounds check on the g0 stack. To do this, we // need to call a splittable function through systemstack(). // SetGCPercent contains such a systemstack call. gogc := debug.SetGCPercent(100) debug.SetGCPercent(gogc) } // Regression test for https://go.dev/issue/62440. It should be possible for C // threads to call into Go from different stacks without crashing due to g0
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Nov 17 15:33:38 UTC 2023 - 1.1K bytes - Viewed (0) -
src/cmd/cgo/internal/test/issue21897.go
#include <CoreFoundation/CoreFoundation.h> */ import "C" import ( "runtime/debug" "testing" "unsafe" ) func test21897(t *testing.T) { // Please write barrier, kick in soon. defer debug.SetGCPercent(debug.SetGCPercent(1)) for i := 0; i < 10000; i++ { testCFNumberRef() testCFDateRef() testCFBooleanRef() // Allocate some memory, so eventually the write barrier is enabled
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 12 12:00:02 UTC 2023 - 1.4K bytes - Viewed (0) -
src/runtime/proc_test.go
// If runtime triggers a forced GC during this test then it will deadlock, // since the goroutines can't be stopped/preempted. // Disable GC for this test (see issue #10958). defer debug.SetGCPercent(debug.SetGCPercent(-1)) // SetGCPercent waits until the mark phase is over, but the runtime // also preempts at the start of the sweep phase, so make sure that's // done too. See #45867. runtime.GC() for try := 0; try < N; try++ {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jun 14 00:03:57 UTC 2023 - 25.8K bytes - Viewed (0) -
src/crypto/rsa/boring_test.go
if err != nil { t.Fatal(err) } // Run test with GOGC=10, to make bug more likely. // Without the KeepAlives, the loop usually dies after // about 30 iterations. defer debug.SetGCPercent(debug.SetGCPercent(10)) for n := 0; n < 200; n++ { // Clear the underlying BoringCrypto object cache. privCache.Clear() // Race to create the underlying BoringCrypto object.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Nov 15 00:16:30 UTC 2022 - 4.5K bytes - Viewed (0) -
src/runtime/rwmutex_test.go
// If runtime triggers a forced GC during this test then it will deadlock, // since the goroutines can't be stopped/preempted. // Disable GC for this test (see issue #10958). defer debug.SetGCPercent(debug.SetGCPercent(-1)) // SetGCPercent waits until the mark phase is over, but the runtime // also preempts at the start of the sweep phase, so make sure that's // done too. GC() doTestParallelReaders(1) doTestParallelReaders(3)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Dec 15 22:00:45 UTC 2023 - 4.2K bytes - Viewed (0) -
src/runtime/testdata/testprog/badtraceback.go
import ( "runtime" "runtime/debug" "unsafe" ) func init() { register("BadTraceback", BadTraceback) } func BadTraceback() { // Disable GC to prevent traceback at unexpected time. debug.SetGCPercent(-1) // Out of an abundance of caution, also make sure that there are // no GCs actively in progress. runtime.GC() // Run badLR1 on its own stack to minimize the stack size and
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 06 23:02:28 UTC 2021 - 1.2K bytes - Viewed (0) -
src/runtime/debug_test.go
// InjectDebugCall cannot be executed while a GC is actively in // progress. Wait until the current GC is done, and turn it off. // // See #49370. runtime.GC() defer debug.SetGCPercent(debug.SetGCPercent(-1)) // Test that the runtime refuses call injection at unsafe points. var g *runtime.G var ready, stop uint32 defer atomic.StoreUint32(&stop, 1) go debugCallUnsafePointWorker(&g, &ready, &stop)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 08 15:08:04 UTC 2023 - 8K bytes - Viewed (0) -
src/sync/pool_test.go
import ( "runtime" "runtime/debug" "slices" . "sync" "sync/atomic" "testing" "time" ) func TestPool(t *testing.T) { // disable GC so we can control when it happens. defer debug.SetGCPercent(debug.SetGCPercent(-1)) var p Pool if p.Get() != nil { t.Fatal("expected empty") } // Make sure that the goroutine doesn't migrate to another P // between Put and Get calls. Runtime_procPin() p.Put("a")
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 8K bytes - Viewed (0)