Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 56 for memState (0.38 sec)

  1. test/fixedbugs/issue15277.go

    		println("second alloc: expected delta at least 9MB, got: ", delta)
    	}
    	runtime.KeepAlive(x)
    }
    
    func main() {
    	x := inuse()
    	f(new(big), x)
    }
    
    func inuse() int64 {
    	runtime.GC()
    	var st runtime.MemStats
    	runtime.ReadMemStats(&st)
    	return int64(st.Alloc)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 851 bytes
    - Viewed (0)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. src/runtime/mheap.go

    	h.cachealloc.init(unsafe.Sizeof(mcache{}), nil, nil, &memstats.mcache_sys)
    	h.specialfinalizeralloc.init(unsafe.Sizeof(specialfinalizer{}), nil, nil, &memstats.other_sys)
    	h.specialprofilealloc.init(unsafe.Sizeof(specialprofile{}), nil, nil, &memstats.other_sys)
    	h.specialReachableAlloc.init(unsafe.Sizeof(specialReachable{}), nil, nil, &memstats.other_sys)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:31:00 UTC 2024
    - 78K bytes
    - Viewed (0)
  8. src/runtime/testdata/testprogcgo/cgonoescape.go

    //go:noinline
    func withoutNoEscape() {
    	var str string
    	C.runCWithoutNoEscape(unsafe.Pointer(&str))
    }
    
    func CgoNoEscape() {
    	// make GC stop to see the heap objects allocated
    	debug.SetGCPercent(-1)
    
    	var stats runtime.MemStats
    	runtime.ReadMemStats(&stats)
    	preHeapObjects := stats.HeapObjects
    
    	for i := 0; i < num; i++ {
    		withNoEscape()
    	}
    
    	runtime.ReadMemStats(&stats)
    	nowHeapObjects := stats.HeapObjects
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 16:43:23 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. src/runtime/export_test.go

    	metricsUnlock()
    
    	startTheWorld(stw)
    }
    
    var DoubleCheckReadMemStats = &doubleCheckReadMemStats
    
    // ReadMemStatsSlow returns both the runtime-computed MemStats and
    // MemStats accumulated by scanning the heap.
    func ReadMemStatsSlow() (base, slow MemStats) {
    	stw := stopTheWorld(stwForTestReadMemStatsSlow)
    
    	// Run on the system stack to avoid stack growth allocation.
    	systemstack(func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
  10. src/runtime/mcheckmark.go

    		arena := mheap_.arenas[ai.l1()][ai.l2()]
    		bitmap := arena.checkmarks
    
    		if bitmap == nil {
    			// Allocate bitmap on first use.
    			bitmap = (*checkmarksMap)(persistentalloc(unsafe.Sizeof(*bitmap), 0, &memstats.gcMiscSys))
    			if bitmap == nil {
    				throw("out of memory allocating checkmarks bitmap")
    			}
    			arena.checkmarks = bitmap
    		} else {
    			// Otherwise clear the existing bitmap.
    			clear(bitmap.b[:])
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 2.8K bytes
    - Viewed (0)
Back to top