[問題] Node.js 延伸模組的 memory leak

作者: Neisseria (Neisseria)   2016-12-23 08:38:33
小弟最近在練習用 Rust 寫高階語言的延伸模組,repo 如下:
https://github.com/cwchentw/libmatrix-rust-demo
但小弟不解的是,為何以 Node.js 撰寫的模組的記憶體用量不斷上升?
小弟用 C 存取此模組,以 Valgrind 檢查沒有 memory leak
$ valgrind ./matrix
==4880== Memcheck, a memory error detector
==4880== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==4880== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==4880== Command: ./matrix
==4880==
==4880==
==4880== HEAP SUMMARY:
==4880== in use at exit: 0 bytes in 0 blocks
==4880== total heap usage: 5,000 allocs, 5,000 frees, 216,000 bytes allocated
==4880==
==4880== All heap blocks were freed

Links booklink

Contact Us: admin [ a t ] ucptt.com