'Understanding total memory usage of Go code hosted in a Swift program
I'm trying to understand the total amount of space taken up by some Go code running in a Swift program. I was able to use pprof to measure the total amount of heap memory taken up (with -alloc_space). What I would like to know is the ratio of total program memory used by the Go vs. the Swift runtime. This would include heap and stack memory, as well as code size. If -alloc_space indeed accomplishes that, then that's great, but I wasn't completely sure. If it doesn't, should I then take the number from the pprof data and just add that to the size of the Go .o that I link into my program?
For some background: iOS has some strict memory requirements for some types of app extensions. I'm trying to understand how much space is being taken up by Go vs. Swift by measuring Go's total footprint, and subtracting that number from the total memory footprint of the program to get the ratio I'm looking for.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
