Comments (2)
The TInyGo garbage collector first searches for enough space to satisfy the allocation; if that fails, then it runs a garbage collection and tries again; if that fails to find enough space, then the heap size is increased until the allocation can be satisfies or the underlying system runs out of memory. If you're encoutering OOMs then my guess is you're experiencing memory fragmentation which is impeding the garbage collector. There is enough space free, just not in a contiguous block.
from tinygo.
@dgryski Thank you for your comment. I am experiencing that after refactoring, my app gets OOMs in some test cases. I have studied the code before and after and cannot find a cause (the code before the refactoring creates a lot of small objects too, so if it is a memory fragmentation, then why the things got worse, I cannot explain)... I am using the -gc=precise and target is wasi BTW.
Are there some debugging tools available for TinyGo that could help to diagnose the roots of the OOMs? For example:
- pprof for TinyGo?
- some debugging log from GC?
- anything else?
from tinygo.
Related Issues (20)
- hid-keyboard not working on nvidia agx orin HOT 12
- Does tinygo not support TLS features?
- Compiling programs SIGKILL on latest arm mac HOT 1
- tinygo build -gc none fails HOT 2
- `Type.AssignableTo` panics with "reflect: unimplemented: AssignableTo with interface"
- Missing C.CBytes HOT 1
- Cgo doesn't support bitshifted constants HOT 2
- Unable to Build LLVM on Windows with GCC Version 11.2.0 HOT 1
- When using Go modules the TinyGo compiler doesn't find the TinyGo packages like machine | ERROR: undefined machine.I2C0 HOT 3
- TypeError: WebAssembly.instantiate(): Import #0 "gojs": module is not an object or function TypeError: Cannot convert a BigInt value to a number HOT 2
- wasm: -target=wasi is now trying to use GOOS=wasip1, which is not existent in Go 1.20 HOT 2
- build with target "wasm-unknown" fail in windows10 22H2 HOT 2
- Cannot compile WASM module in 0.32.0 but works in 0.31.2 HOT 3
- wasm-unknown target shouldn't set `--import-memory` by default HOT 2
- Ability to pass flags to external linker (such as `wasm-ld`) HOT 1
- cannot use `tinygo build -ldflags "-X 'main.WASM_NAME=ws_conn.wasm'"` to modify variable WASM_NAME
- RP2040 I2C Target mode doubles first byte sent in Reply HOT 4
- tinygo fails to build at Arch Linux clean environment HOT 10
- "Over The Air" updates for Pico-w HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinygo.