Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for memState (1.1 sec)

  1. src/cmd/compile/internal/ssa/tighten.go

    	// Compute the memory states of each block.
    	startMem := f.Cache.allocValueSlice(f.NumBlocks())
    	defer f.Cache.freeValueSlice(startMem)
    	endMem := f.Cache.allocValueSlice(f.NumBlocks())
    	defer f.Cache.freeValueSlice(endMem)
    	memState(f, startMem, endMem)
    
    	for _, b := range f.Blocks {
    		for _, v := range b.Values {
    			if v.Op.isLoweredGetClosurePtr() {
    				// Must stay in the entry block.
    				continue
    			}
    			switch v.Op {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 16 01:01:38 UTC 2023
    - 7.7K bytes
    - Viewed (0)
  2. test/gc2.go

    func main() {
    	const N = 10000
    	st := new(runtime.MemStats)
    	memstats := new(runtime.MemStats)
    	runtime.ReadMemStats(st)
    	for i := 0; i < N; i++ {
    		c := make(chan int, 10)
    		_ = c
    		if i%100 == 0 {
    			for j := 0; j < 4; j++ {
    				runtime.GC()
    				runtime.Gosched()
    				runtime.GC()
    				runtime.Gosched()
    			}
    		}
    	}
    
    	runtime.ReadMemStats(memstats)
    	obj := int64(memstats.HeapObjects - st.HeapObjects)
    	if obj > N/5 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 977 bytes
    - Viewed (0)
  3. src/testing/allocs.go

    	// Warm up the function
    	f()
    
    	// Measure the starting statistics
    	var memstats runtime.MemStats
    	runtime.ReadMemStats(&memstats)
    	mallocs := 0 - memstats.Mallocs
    
    	// Run the function the specified number of times
    	for i := 0; i < runs; i++ {
    		f()
    	}
    
    	// Read the final statistics
    	runtime.ReadMemStats(&memstats)
    	mallocs += memstats.Mallocs
    
    	// Average the mallocs over the runs (not counting the warm-up).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 02 00:13:47 UTC 2016
    - 1.4K bytes
    - Viewed (0)
  4. cmd/admin-server-info.go

    		Uptime:   UTCNow().Unix() - globalBootTime.Unix(),
    		Version:  Version,
    		CommitID: CommitID,
    		Network:  network,
    		MemStats: madmin.MemStats{
    			Alloc:      memstats.Alloc,
    			TotalAlloc: memstats.TotalAlloc,
    			Mallocs:    memstats.Mallocs,
    			Frees:      memstats.Frees,
    			HeapAlloc:  memstats.HeapAlloc,
    		},
    		GoMaxProcs:     runtime.GOMAXPROCS(0),
    		NumCPU:         runtime.NumCPU(),
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  5. test/closure.go

    	go h()
    	check([]int{100, 200, 101, 201, 500, 101, 201, 500})
    
    	memstats := new(runtime.MemStats)
    	runtime.ReadMemStats(memstats)
    	n0 := memstats.Mallocs
    
    	x, y := newfunc(), newfunc()
    	if x(1) != 1 || y(2) != 2 {
    		println("newfunc returned broken funcs")
    		fail = true
    	}
    
    	runtime.ReadMemStats(memstats)
    	if n0 != memstats.Mallocs {
    		println("newfunc allocated unexpectedly")
    		fail = true
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Jul 01 17:59:50 UTC 2012
    - 1.7K bytes
    - Viewed (0)
  6. test/chan/select2.go

    	receiver(c, dummy, 100000)
    	runtime.GC()
    	memstats := new(runtime.MemStats)
    	runtime.ReadMemStats(memstats)
    	alloc := memstats.Alloc
    
    	// second time shouldn't increase footprint by much
    	go sender(c, 100000)
    	receiver(c, dummy, 100000)
    	runtime.GC()
    	runtime.ReadMemStats(memstats)
    
    	// Be careful to avoid wraparound.
    	if memstats.Alloc > alloc && memstats.Alloc-alloc > 1.1e5 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 1K bytes
    - Viewed (0)
  7. test/init1.go

    	go send(c)
    	<-c
    
    	const N = 1000
    	const MB = 1 << 20
    	b := make([]byte, MB)
    	for i := range b {
    		b[i] = byte(i%10 + '0')
    	}
    	s := string(b)
    
    	memstats := new(runtime.MemStats)
    	runtime.ReadMemStats(memstats)
    	sys, numGC := memstats.Sys, memstats.NumGC
    
    	// Generate 1,000 MB of garbage, only retaining 1 MB total.
    	for i := 0; i < N; i++ {
    		x = []byte(s)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 1.1K bytes
    - Viewed (0)
  8. pkg/ctrlz/topics/mem.go

    		ms := &runtime.MemStats{}
    		runtime.ReadMemStats(ms)
    		fw.RenderHTML(w, tmpl, ms)
    	})
    
    	_ = context.JSONRouter().StrictSlash(true).NewRoute().Methods("GET").Path("/").HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
    		ms := &runtime.MemStats{}
    		runtime.ReadMemStats(ms)
    		fw.RenderJSON(w, http.StatusOK, ms)
    	})
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 14:06:41 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  9. src/runtime/traceregion.go

    	for a.full != nil {
    		block := a.full
    		a.full = block.next
    		sysFree(unsafe.Pointer(block), unsafe.Sizeof(traceRegionAllocBlock{}), &memstats.other_sys)
    	}
    	if current := a.current.Load(); current != nil {
    		sysFree(current, unsafe.Sizeof(traceRegionAllocBlock{}), &memstats.other_sys)
    		a.current.Store(nil)
    	}
    	a.dropping.Store(false)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:47:01 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  10. src/expvar/expvar.go

    	return os.Args
    }
    
    func memstats() any {
    	stats := new(runtime.MemStats)
    	runtime.ReadMemStats(stats)
    	return *stats
    }
    
    func init() {
    	if godebug.New("httpmuxgo121").Value() == "1" {
    		http.HandleFunc("/debug/vars", expvarHandler)
    	} else {
    		http.HandleFunc("GET /debug/vars", expvarHandler)
    	}
    	Publish("cmdline", Func(cmdline))
    	Publish("memstats", Func(memstats))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
Back to top