Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for memState (0.28 sec)

  1. src/runtime/mstats.go

    		// should be identical to some combination of memstats. In particular:
    		//
    		// * memstats.heapInUse == inHeap
    		// * memstats.heapReleased == released
    		// * memstats.heapInUse + memstats.heapFree == committed - inStacks - inWorkBufs - inPtrScalarBits
    		// * memstats.totalAlloc == totalAlloc
    		// * memstats.totalFree == totalFree
    		//
    		// Check if that's actually true.
    		//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 08 21:03:13 UTC 2024
    - 34.2K bytes
    - Viewed (0)
  2. src/testing/benchmark.go

    // before a benchmark starts, but it can also be used to resume timing after
    // a call to [B.StopTimer].
    func (b *B) StartTimer() {
    	if !b.timerOn {
    		runtime.ReadMemStats(&memStats)
    		b.startAllocs = memStats.Mallocs
    		b.startBytes = memStats.TotalAlloc
    		b.start = highPrecisionTimeNow()
    		b.timerOn = true
    	}
    }
    
    // StopTimer stops timing a test. This can be used to pause the timer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  3. src/runtime/testdata/testprog/gc.go

    func GCSys() {
    	runtime.GOMAXPROCS(1)
    	memstats := new(runtime.MemStats)
    	runtime.GC()
    	runtime.ReadMemStats(memstats)
    	sys := memstats.Sys
    
    	runtime.MemProfileRate = 0 // disable profiler
    
    	itercount := 100000
    	for i := 0; i < itercount; i++ {
    		workthegc()
    	}
    
    	// Should only be using a few MB.
    	// We allocated 100 MB or (if not short) 1 GB.
    	runtime.ReadMemStats(memstats)
    	if sys > memstats.Sys {
    		sys = 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Oct 02 02:28:27 UTC 2022
    - 12.1K bytes
    - Viewed (0)
  4. src/runtime/metrics.go

    	a.stacksSys = memstats.stacks_sys.load()
    	a.buckHashSys = memstats.buckhash_sys.load()
    	a.gcMiscSys = memstats.gcMiscSys.load()
    	a.otherSys = memstats.other_sys.load()
    	a.heapGoal = gcController.heapGoal()
    	a.gcCyclesDone = uint64(memstats.numgc)
    	a.gcCyclesForced = uint64(memstats.numforcedgc)
    
    	systemstack(func() {
    		lock(&mheap_.lock)
    		a.mSpanSys = memstats.mspan_sys.load()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 08 21:03:13 UTC 2024
    - 26K bytes
    - Viewed (0)
  5. src/runtime/mcache.go

    		// Count up how many slots were used and record it.
    		stats := memstats.heapStats.acquire()
    		slotsUsed := int64(s.allocCount) - int64(s.allocCountBeforeCache)
    		atomic.Xadd64(&stats.smallAllocCount[spc.sizeclass()], slotsUsed)
    
    		// Flush tinyAllocs.
    		if spc == tinySpanClass {
    			atomic.Xadd64(&stats.tinyAllocCount, int64(c.tinyAllocs))
    			c.tinyAllocs = 0
    		}
    		memstats.heapStats.release()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10K bytes
    - Viewed (0)
  6. src/runtime/heapdump.go

    		dumpint(uint64(uintptr(unsafe.Pointer(mp))))
    		dumpint(uint64(mp.id))
    		dumpint(mp.procid)
    	}
    }
    
    //go:systemstack
    func dumpmemstats(m *MemStats) {
    	assertWorldStopped()
    
    	// These ints should be identical to the exported
    	// MemStats structure and should be ordered the same
    	// way too.
    	dumpint(tagMemStats)
    	dumpint(m.Alloc)
    	dumpint(m.TotalAlloc)
    	dumpint(m.Sys)
    	dumpint(m.Lookups)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  7. src/runtime/gc_test.go

    	*runtime.DoubleCheckReadMemStats = true
    }
    
    func TestReadMemStats(t *testing.T) {
    	base, slow := runtime.ReadMemStatsSlow()
    	if base != slow {
    		logDiff(t, "MemStats", reflect.ValueOf(base), reflect.ValueOf(slow))
    		t.Fatal("memstats mismatch")
    	}
    }
    
    func logDiff(t *testing.T, prefix string, got, want reflect.Value) {
    	typ := got.Type()
    	switch typ.Kind() {
    	case reflect.Array, reflect.Slice:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  8. src/runtime/debug/garbage.go

    // managed by the Go runtime).
    //
    // More specifically, the following expression accurately reflects
    // the value the runtime attempts to maintain as the limit:
    //
    //	runtime.MemStats.Sys - runtime.MemStats.HeapReleased
    //
    // or in terms of the runtime/metrics package:
    //
    //	/memory/classes/total:bytes - /memory/classes/heap/released:bytes
    //
    // A zero limit or a limit that's lower than the amount of memory
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  9. src/runtime/malloc_test.go

    	"time"
    	"unsafe"
    )
    
    var testMemStatsCount int
    
    func TestMemStats(t *testing.T) {
    	testMemStatsCount++
    
    	// Make sure there's at least one forced GC.
    	GC()
    
    	// Test that MemStats has sane values.
    	st := new(MemStats)
    	ReadMemStats(st)
    
    	nz := func(x any) error {
    		if x != reflect.Zero(reflect.TypeOf(x)).Interface() {
    			return nil
    		}
    		return fmt.Errorf("zero value")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:29 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  10. src/runtime/pprof/pprof.go

    }
    
    func writeHeapInternal(w io.Writer, debug int, defaultSampleType string) error {
    	var memStats *runtime.MemStats
    	if debug != 0 {
    		// Read mem stats first, so that our other allocations
    		// do not appear in the statistics.
    		memStats = new(runtime.MemStats)
    		runtime.ReadMemStats(memStats)
    	}
    
    	// Find out how many records there are (MemProfile(nil, true)),
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 30.6K bytes
    - Viewed (0)
Back to top