While looking at how to get memory usage info in mac, I came across two methods.
- Using system command
Here we can get the pid of the process(dgraph) from os.Getpid(). And then use exec package to run
ps -ao rss,pid | grep <pid> and get the RSS of the process.
- Using task_info struct:
This would require writing some C code to get the
task_info struct and then using CGO to get the resident_size field.
What are your thoughts on the best approach? @core-devs