It seems likely that the Pulsar Go client does not use CGO by default. The current (non-CGo) Go client is implemented in pure Go, and the CGo-based client has been deprecated since Pulsar 2.7.0. If your application is using the standard Go client, it should not be using CGO unless you have explicitly enabled it or are using a very old version. High resident memory usage compared to Go heap may be due to native libraries (e.g., compression like ZStd) or memory fragmentation, but not due to CGO unless you are using the deprecated client or have enabled native ZStd via CGO, which is optional and only used if CGO is enabled at build time (
source,
source).
If you are seeing much higher resident memory than Go heap, and you are not using the deprecated CGo client, it may be related to native memory allocations from libraries like ZStd or other system calls, not CGO itself. You can check your build and dependencies to confirm whether CGO is enabled. Would you like more detail on how to check for CGO usage or memory profiling in Go?
Sources:
-
https://github.com/apache/pulsar-client-go/pull/270
-
https://github.com/apache/pulsar/pull/14766 👍 0 button 👎 0 button 💡
Hint: Mention @runllm in the thread for followups.