@cryptotaxi247 / kubo / commits / 295fd96bd

docs: clarify Swarm.ResourceMgr.MaxMemory (#10622)

related to ux problem described in #10621

Marcin Rataj committed Dec 20, 2024 at 00:48 UTC 295fd96bd0ce9afac62ab5afb5b775a5702258aa
1 file changed +7 -1
docs/config.md
+7 -1
@@ -2119,7 +2119,8 @@ Type: `flag`
2119
2120 #### `Swarm.ResourceMgr.MaxMemory`
2121
2122 -This is the max amount of memory to allow libp2p to use.
2122 +This is the max amount of memory to allow go-libp2p to use.
2123 +
2124 libp2p's resource manager will prevent additional resource creation while this limit is reached.
2125 This value is also used to scale the limit on various resources at various scopes
2126 when the default limits (discussed in [libp2p resource management](./libp2p-resource-management.md)) are used.
@@ -2127,6 +2128,11 @@ For example, increasing this value will increase the default limit for incoming
2128
2129 It is possible to inspect the runtime limits via `ipfs swarm resources --help`.
2130
2131 +> [!IMPORTANT]
2132 +> `Swarm.ResourceMgr.MaxMemory` is the memory limit for go-libp2p networking stack alone, and not for entire Kubo or Bitswap.
2133 +>
2134 +> To set memory limit for the entire Kubo process, use [`GOMEMLIMIT` environment variable](http://web.archive.org/web/20240222201412/https://kupczynski.info/posts/go-container-aware/) which all Go programs recognize, and then set `Swarm.ResourceMgr.MaxMemory` to less than your custom `GOMEMLIMIT`.
2135 +
2136 Default: `[TOTAL_SYSTEM_MEMORY]/2`
2137 Type: `optionalBytes`
2138