Comments (6)
I think I can find the reason.
Let me fix on 0.9.0-rc1 in next week. Thanks.
from dapr-wasm.
Thanks @Taction for reporting this issue.
I spent some time to reproduce it, it seems memory does not released after infer
processed, here is a sample of memory I got:
@juntao Could you let any WasmEdge VM developer to have a look?
Here is the branch I used for testing:
https://github.com/chenyukang/dapr-wasm/tree/debug-mem
Here is the script used to reproduce it: https://github.com/chenyukang/dapr-wasm/blob/debug-mem/image-api-go/run_mem.sh
from dapr-wasm.
Thanks. @q82419 Can you look into this? It appears that the TF host function call has a memory leak. Thanks.
from dapr-wasm.
Hi @chenyukang ,
I think the life-cycle in go may cause memory issue.
It's proper to use conf.Delete()
directly after VM creation rather than use defer
here,
And use vm.Delete()
directly after VM execution rather than use defer
here.
And the import objects created here should call the Delete()
methods after VM deleted.
For the wasmedge_tensorflow_interface
rust crate, I fixed the memory issue in rust and you can use the 0.2.2
version.
But after all, the memory leak in rust which will be compiled into WASM will all disappear after VM deletion.
I've overviewed the WasmEdge-Tensorflow
and I cannot find the un-deallocated objects now.
Maybe we can look into and find the reason in the future, and the following graph shows that it's better after the adjustment:
Thanks.
from dapr-wasm.
Hi @chenyukang ,
I think the life-cycle in go may cause memory issue. It's proper to use
conf.Delete()
directly after VM creation rather than usedefer
here, And usevm.Delete()
directly after VM execution rather than usedefer
here. And the import objects created here should call theDelete()
methods after VM deleted.For the
wasmedge_tensorflow_interface
rust crate, I fixed the memory issue in rust and you can use the0.2.2
version. But after all, the memory leak in rust which will be compiled into WASM will all disappear after VM deletion. I've overviewed theWasmEdge-Tensorflow
and I cannot find the un-deallocated objects now. Maybe we can look into and find the reason in the future, and the following graph shows that it's better after the adjustment:Thanks.
Thanks for investigation, I will update the code as you suggested.
BTW, what is the difference between defer
and manually call Delete
.
Actually, the original code is Delete
, I changed it to defer when debugging the issue.
from dapr-wasm.
I closed this issue since pr #20 is merged. Feel free to reopen this issue, if there is anything wrong. @Taction
from dapr-wasm.
Related Issues (13)
- Seems the wasm file is missed HOT 1
- Error: error getting topics from app - unexpected end of JSON input - error occurred while beginning pubsub messages HOT 2
- Create WasmEdge HTTP server sidecars HOT 15
- Create a customized WasmEdge for dapr HOT 3
- [error] jpeg is invalid. HOT 1
- make run-api-wasi-socket-rs error with Mismatched function type
- Use wasmedge-bindgen instead of wasm-bindgen in the GO SDK example HOT 5
- live demo is down? HOT 4
- GitHub Pages HOT 4
- Remove the functions folder
- Image formats HOT 4
- Inconsistent document/webpage link to this repo HOT 1
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 dapr-wasm.