Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
module main
import veb { Result }
pub struct Context {
veb.Context
}
pub struct App {
}
fn main() {
mut app := App{}
veb.run_at[App, Context](mut app, veb.RunParams{
host: '0.0.0.0'
family: .ip
}) or { panic(err) }
}
fn (app &App) index(mut ctx Context) Result {
return ctx.json('')
}
compile it with: v -cg -cc gcc -keepc -gc none /home/esquerbatua/git/breakV/jsonx.v -o vebLeak
run it with: heaptrack ./vebLeak
make a few requests and close the app, then run: heaptrack --analyze <generated .zst file>
Expected Behavior
Run without any memory leak
Current Behavior
Memory leaks, even with boehm.
Possible Solution
Manual free in vlib functions of picoev and veb?
Additional Information/Context
No response
V version
V full version: V 0.4.7 01fd719.a63d349
Environment details (OS name and version, etc.)
V full version: V 0.4.7 01fd719.a63d349
OS: linux, Ubuntu 24.04.1 LTS
Processor: 16 cpus, 64bit, little endian, AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Describe the bug
veb leaks memory, also maybe picoev
Reproduction Steps
With this code:
compile it with:
v -cg -cc gcc -keepc -gc none /home/esquerbatua/git/breakV/jsonx.v -o vebLeak
run it with:heaptrack ./vebLeak
make a few requests and close the app, then run:heaptrack --analyze <generated .zst file>
Expected Behavior
Run without any memory leak
Current Behavior
Memory leaks, even with boehm.
Possible Solution
Manual free in vlib functions of picoev and veb?
Additional Information/Context
No response
V version
V full version: V 0.4.7 01fd719.a63d349
Environment details (OS name and version, etc.)
V full version: V 0.4.7 01fd719.a63d349 OS: linux, Ubuntu 24.04.1 LTS Processor: 16 cpus, 64bit, little endian, AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
getwd: /home/esquerbatua/git/v vexe: /home/esquerbatua/git/v/v vexe mtime: 2024-08-31 19:03:12
vroot: OK, value: /home/esquerbatua/git/v VMODULES: OK, value: /home/esquerbatua/.vmodules VTMP: OK, value: /tmp/v_1000
Git version: git version 2.43.0 Git vroot status: weekly.2024.35-7-ga63d3493 .git/config present: true
CC version: cc (Ubuntu 13.2.0-23ubuntu4) 13.2.0 thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9