func (c *Memory) GetSamplingProfile() (*MemorySamplingProfile, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.getSamplingProfile"})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Profile *MemorySamplingProfile
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Profile, nil
}
GetSamplingProfile - Retrieve native memory allocations profile collected since last `startSampling` call.
Returns -  profile -
package gcdapi
import (
	"encoding/json"
	"github.com/wirepair/gcd/gcdmessage"
)
type MemorySamplingProfileNode struct {
	Size  float64  `json:"size"`   
	Total float64  `json:"total"`  
	Stack []string `json:"stack"`  
}
type MemorySamplingProfile struct {
	Samples []*MemorySamplingProfileNode `json:"samples"`  
	Modules []*MemoryModule              `json:"modules"`  
}
type MemoryModule struct {
	Name        string  `json:"name"`         
	Uuid        string  `json:"uuid"`         
	BaseAddress string  `json:"baseAddress"`  
	Size        float64 `json:"size"`         
}
type Memory struct {
	target gcdmessage.ChromeTargeter
}
func NewMemory(target gcdmessage.ChromeTargeter) *Memory {
	c := &Memory{target: target}
	return c
}
func (c *Memory) GetDOMCounters() (int, int, int, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.getDOMCounters"})
	if err != nil {
		return 0, 0, 0, err
	}
	var chromeData struct {
		Result struct {
			Documents        int
			Nodes            int
			JsEventListeners int
		}
	}
	if resp == nil {
		return 0, 0, 0, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return 0, 0, 0, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return 0, 0, 0, err
	}
	return chromeData.Result.Documents, chromeData.Result.Nodes, chromeData.Result.JsEventListeners, nil
}
func (c *Memory) PrepareForLeakDetection() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.prepareForLeakDetection"})
}
type MemorySetPressureNotificationsSuppressedParams struct {
	Suppressed bool `json:"suppressed"`
}
func (c *Memory) SetPressureNotificationsSuppressedWithParams(v *MemorySetPressureNotificationsSuppressedParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.setPressureNotificationsSuppressed", Params: v})
}
func (c *Memory) SetPressureNotificationsSuppressed(suppressed bool) (*gcdmessage.ChromeResponse, error) {
	var v MemorySetPressureNotificationsSuppressedParams
	v.Suppressed = suppressed
	return c.SetPressureNotificationsSuppressedWithParams(&v)
}
type MemorySimulatePressureNotificationParams struct {
	Level string `json:"level"`
}
func (c *Memory) SimulatePressureNotificationWithParams(v *MemorySimulatePressureNotificationParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.simulatePressureNotification", Params: v})
}
func (c *Memory) SimulatePressureNotification(level string) (*gcdmessage.ChromeResponse, error) {
	var v MemorySimulatePressureNotificationParams
	v.Level = level
	return c.SimulatePressureNotificationWithParams(&v)
}
type MemoryStartSamplingParams struct {
	SamplingInterval int `json:"samplingInterval,omitempty"`
	SuppressRandomness bool `json:"suppressRandomness,omitempty"`
}
func (c *Memory) StartSamplingWithParams(v *MemoryStartSamplingParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.startSampling", Params: v})
}
func (c *Memory) StartSampling(samplingInterval int, suppressRandomness bool) (*gcdmessage.ChromeResponse, error) {
	var v MemoryStartSamplingParams
	v.SamplingInterval = samplingInterval
	v.SuppressRandomness = suppressRandomness
	return c.StartSamplingWithParams(&v)
}
func (c *Memory) StopSampling() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.stopSampling"})
}
func (c *Memory) GetAllTimeSamplingProfile() (*MemorySamplingProfile, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.getAllTimeSamplingProfile"})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Profile *MemorySamplingProfile
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Profile, nil
}
func (c *Memory) GetBrowserSamplingProfile() (*MemorySamplingProfile, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Memory.getBrowserSamplingProfile"})
	if err != nil {
		return nil, err
	}
	var chromeData struct {
		Result struct {
			Profile *MemorySamplingProfile
		}
	}
	if resp == nil {
		return nil, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return nil, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return nil, err
	}
	return chromeData.Result.Profile, nil
}