Improve attachment memory allocation (#105)
* Improve attachment memory allocation * added explicit garbage collection * redundant GC * added GCs in attachment processor and a FreeOSMemory helper * added changelog * linting * Remove commented call to debug.FreeOSMemory Co-authored-by: marin thiercelin <marin.thiercelin@pm.me> Co-authored-by: marinthiercelin <marin.thiercelin@epfl.ch>
This commit is contained in:
parent
75f27fd1df
commit
6105a3bcc0
3 changed files with 30 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package helper
|
|||
import (
|
||||
"encoding/json"
|
||||
goerrors "errors"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||
"github.com/pkg/errors"
|
||||
|
|
@ -124,3 +125,10 @@ func EncryptSignBinaryDetachedMobile(
|
|||
EncryptedSignatureArmored: encryptedSignature,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// FreeOSMemory can be used to explicitly
|
||||
// call the garbage collector and
|
||||
// return the unused memory to the OS.
|
||||
func FreeOSMemory() {
|
||||
debug.FreeOSMemory()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue