Merge pull request #15124 from fjl/debug-gcpercent
internal/debug: add debug_setGCPercent
This commit is contained in:
		@@ -181,6 +181,12 @@ func (*HandlerT) FreeOSMemory() {
 | 
				
			|||||||
	debug.FreeOSMemory()
 | 
						debug.FreeOSMemory()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// SetGCPercent sets the garbage collection target percentage. It returns the previous
 | 
				
			||||||
 | 
					// setting. A negative value disables GC.
 | 
				
			||||||
 | 
					func (*HandlerT) SetGCPercent(v int) int {
 | 
				
			||||||
 | 
						return debug.SetGCPercent(v)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func writeProfile(name, file string) error {
 | 
					func writeProfile(name, file string) error {
 | 
				
			||||||
	p := pprof.Lookup(name)
 | 
						p := pprof.Lookup(name)
 | 
				
			||||||
	log.Info("Writing profile records", "count", p.Count(), "type", name, "dump", file)
 | 
						log.Info("Writing profile records", "count", p.Count(), "type", name, "dump", file)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -267,6 +267,11 @@ web3._extend({
 | 
				
			|||||||
			call: 'debug_freeOSMemory',
 | 
								call: 'debug_freeOSMemory',
 | 
				
			||||||
			params: 0,
 | 
								params: 0,
 | 
				
			||||||
		}),
 | 
							}),
 | 
				
			||||||
 | 
							new web3._extend.Method({
 | 
				
			||||||
 | 
								name: 'setGCPercent',
 | 
				
			||||||
 | 
								call: 'debug_setGCPercent',
 | 
				
			||||||
 | 
								params: 1,
 | 
				
			||||||
 | 
							}),
 | 
				
			||||||
		new web3._extend.Method({
 | 
							new web3._extend.Method({
 | 
				
			||||||
			name: 'memStats',
 | 
								name: 'memStats',
 | 
				
			||||||
			call: 'debug_memStats',
 | 
								call: 'debug_memStats',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user