in RPG, Voxel

This Week In Veloren 175

From Veloren: link to original post

This week, we hear about an issue with memory leaking somewhere in the memory pipeline.

- AngelOnFira, TWiV Editor

Contributor Work

Thanks to this week's contributors, @Christof, @imbris, @XVar, @Slipped, and @terrarier2111!

Veloren memory leak by @YuriMomo

This week, @YuriMomo found a memory leak in the Veloren.

As we can see, Veloren is taking up significantly more RAM than it should. @YuriMomo dove deeper into the problem to diagnose it. They found that something was constantly allocating 32 bytes each frame, which added up over time.

Although this memory would be freed just fine after the game closes, it's clearly living for longer than it should. Ideally, it should be cleaned up after each frame. A little more analysis lead to discovering this code:

#[no_mangle]
pub unsafe extern "C" fn wgpu_render_pass_push_debug_group(
    pass: &mut RenderPass,
    label: RawString,
    color: u32,
) {
    let bytes = ffi::CStr::from_ptr(label).to_bytes();
    pass.base.string_data.extend_from_slice(bytes);

    pass.base.commands.push(RenderCommand::PushDebugGroup {
        color,
        len: bytes.len(),
    });
}

Which was passing information from Veloren to wgpu, the rendering API that Veloren uses. Some more diagnostics were run, and @imbris mentioned that the problem seemed to be deeper than what we have access to through just the wgpu API.

This issue still has not been fully resolved, but more people on the team are looking into parts of it. More to come in the future!

Flying through the valley. See you next week!

Support the project!

Veloren Open Collective