feat: add GOMEMLIMIT

main
sudo pacman -Syu 2023-08-17 16:48:31 +07:00
parent 1d1c193c94
commit 53d968a922
2 changed files with 16 additions and 0 deletions

View File

@ -152,6 +152,10 @@
<li><code>-trimpath</code> to support reproduce build.</li>
<li><code>-ldflags="-s -w"</code> to strip debugging information.</li>
</ul>
<p>Also there are some experiment:</p>
<ul>
<li><code>GOMEMLIMIT=1024MiB</code>: soft memory limit.</li>
</ul>
<div class="highlight highlight-source-dockerfile">
<pre><span class="pl-k">FROM</span> gcr.io/distroless/base-debian11
@ -184,6 +188,13 @@
>Shrink your Go binaries with this one weird trick</a
>
</li>
<li>
<a
href="https://weaviate.io/blog/gomemlimit-a-game-changer-for-high-memory-applications"
rel="nofollow"
>GOMEMLIMIT is a game changer for high-memory applications</a
>
</li>
</ul>
<div>

View File

@ -90,6 +90,10 @@ This is where I build Go program.
- `-trimpath` to support reproduce build.
- `-ldflags="-s -w"` to strip debugging information.
Also there are some experiment:
- `GOMEMLIMIT=1024MiB`: soft memory limit.
```Dockerfile
FROM gcr.io/distroless/base-debian11
@ -104,3 +108,4 @@ Finally, I copy `app` to Distroless base image.
- [How to start a Go project in 2023](https://boyter.org/posts/how-to-start-go-project-2023/)
- [Shrink your Go binaries with this one weird trick](https://words.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/)
- [GOMEMLIMIT is a game changer for high-memory applications](https://weaviate.io/blog/gomemlimit-a-game-changer-for-high-memory-applications)