Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UPDATED DETAILS] Causing memory leak across all clients on MMO based game. AS1-AS2, AS3. #17023

Open
outrageddevil opened this issue Jul 7, 2024 · 0 comments
Labels
bug Something isn't working wgpu-oom An out-of-memory error from within wgpu

Comments

@outrageddevil
Copy link

outrageddevil commented Jul 7, 2024

Describe the bug

In our multiplayer game Ruffle is causing pretty decent size memory leaking with 2 consistent players.. even worse with 10-20 players. It seems to happen when loading in player/room assets after leaving and coming back to any room. As seen in the video, loading assets slowly starts to slow down as Google is slowly running out of memory to use. This not only happens on the local players computer, but across all users that are inside the room.

Please keep in mind this is not an issue on Native Flash player browsers, for example Flash Browser.

Game possibly utilizes loader objects to dynamically load SWF files and other assets at runtime. Then used unload() method of the loader object to remove loaded content from memory.
More likely utilizes removeMovieClip!

Video:
https://streamable.com/snyy32?src=player-page-share

First Ruffle Error Displayed after crashing because of memory:

ruffle_web-wasm_extensions.js:1149 panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error

Caused by:
    In Device::create_buffer
    Not enough memory left.



Stack:

Error
    at n.wbg.__wbg_new_abda76e883ba8a5f (https://unpkg.com/@ruffle-rs/ruffle/core.ruffle.552d39c….js:1:15987)
    at ruffle_web.wasm.core::ops::function::FnOnce::call_once{{vtable.shim}}::hb6628cc5b211f9fb (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[9875]:0x97eb4f)
    at ruffle_web.wasm.std::panicking::rust_panic_with_hook::h6731baa78621a747 (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[6547]:0x8642a2)
    at ruffle_web.wasm.core::panicking::panic_fmt::h5c7ce52813e94bcd (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[10310]:0x9a9aa1)
    at ruffle_web.wasm.core::ops::function::Fn::call::ha9bb06c582fc9b82 (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[6847]:0x8817bd)
    at ruffle_web.wasm.<T as wgpu::context::DynContext>::device_create_buffer::h6674a0812f77e93f (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[7675]:0x8c7ec3)
    at ruffle_web.wasm.<wgpu::Device as wgpu::util::device::DeviceExt>::create_buffer_init::hc400bae5a62cada5 (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[1878]:0x4fad03)
    at ruffle_web.wasm.ruffle_render_wgpu::buffer_builder::BufferBuilder::finish::ha623aac2bda0561f (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[7821]:0x8cef77)
    at ruffle_web.wasm.ruffle_render_wgpu::backend::WgpuRenderBackend<T>::register_shape_internal::habec7ed44ba096d4 (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[1060]:0x2e9d12)
    at ruffle_web.wasm.<ruffle_render_wgpu::backend::WgpuRenderBackend<T> as ruffle_render::backend::RenderBackend>::register_shape::h5e5390fd90d8f520 (wasm://wasm/ruffle_web.wasm-0338ba62:wasm-function[2974]:0x6453e6)

Second Ruffle Error Displayed after crashing because of memory:

Uncaught RuntimeError: unreachable
    at ruffle_web.wasm.std::panicking::rust_panic_with_hook::h6731baa78621a747 (ruffle_web.wasm-0338ba62:0x8642c8)
    at ruffle_web.wasm.core::panicking::panic_fmt::h5c7ce52813e94bcd (ruffle_web.wasm-0338ba62:0x9a9aa1)
    at ruffle_web.wasm.core::ops::function::Fn::call::ha9bb06c582fc9b82 (ruffle_web.wasm-0338ba62:0x8817bd)
    at ruffle_web.wasm.<T as wgpu::context::DynContext>::device_create_buffer::h6674a0812f77e93f (ruffle_web.wasm-0338ba62:0x8c7ec3)
    at ruffle_web.wasm.<wgpu::Device as wgpu::util::device::DeviceExt>::create_buffer_init::hc400bae5a62cada5 (ruffle_web.wasm-0338ba62:0x4fad03)
    at ruffle_web.wasm.ruffle_render_wgpu::buffer_builder::BufferBuilder::finish::ha623aac2bda0561f (ruffle_web.wasm-0338ba62:0x8cef77)
    at ruffle_web.wasm.ruffle_render_wgpu::backend::WgpuRenderBackend<T>::register_shape_internal::habec7ed44ba096d4 (ruffle_web.wasm-0338ba62:0x2e9d12)
    at ruffle_web.wasm.<ruffle_render_wgpu::backend::WgpuRenderBackend<T> as ruffle_render::backend::RenderBackend>::register_shape::h5e5390fd90d8f520 (ruffle_web.wasm-0338ba62:0x6453e6)
    at ruffle_web.wasm.ruffle_core::display_object::movie_clip::MovieClipData::define_shape::h2eddc33937daaaff (ruffle_web.wasm-0338ba62:0x767e83)
    at ruffle_web.wasm.ruffle_core::display_object::movie_clip::MovieClip::preload::h2a563bf319411b4c (ruffle_web.wasm-0338ba62:0x1bf059)

ruffle web-wasm_extension.js:714

        const ret = wasm.ruffleinstancebuilder_new();
        this.__wbg_ptr = ret >>> 0;
        return this;
    }

1memory
2memory
Dupe
Fatt

Expected behavior

Multiple client connection and loading assets without memory leaking, or at least to a minimum.

Content Location

AS1-AS2 SWF Versions:
https://git.solero.me/solero/legacy-media
AS2-AS3 SWF Versions:
https://git.solero.me/solero/vanilla-media
Game Client:
https://github.com/solero/houdini
AS1-AS2 Demo (Legacy Media) :
https://play.cporiginal.net
AS3 Demo (Vanilla Media) :
https://beta.cporiginal.net
^^^^^^^^^^^^^^^^^
For testing you can use these login details:
Username: TestAccount
Password: TestAccount32

Affected platform

Browser's extension

Operating system

Windows 11

Browser

Google Chrome Version 126.0.6478.127 (Official Build) (64-bit)

Additional information

The client runs off of TCP connection, so to solve that issue there is a Websockify Proxy setup to connect Websockets to the TCP connection that has to be established to communicate to the game client.

@outrageddevil outrageddevil added the bug Something isn't working label Jul 7, 2024
@sleepycatcoding sleepycatcoding added the wgpu-oom An out-of-memory error from within wgpu label Jul 8, 2024
@outrageddevil outrageddevil changed the title Causing memory leak across all clients on MMO based game. AS1-AS2, AS3. [UPDATED DETAILS] Causing memory leak across all clients on MMO based game. AS1-AS2, AS3. Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wgpu-oom An out-of-memory error from within wgpu
Projects
None yet
Development

No branches or pull requests

2 participants