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

GPU process Crashes #18

Open
ERmilburn02 opened this issue Jun 6, 2024 · 1 comment
Open

GPU process Crashes #18

ERmilburn02 opened this issue Jun 6, 2024 · 1 comment

Comments

@ERmilburn02
Copy link

Once a texture is loaded, it's never unloaded, leading to large VRAM usage, and possible GPU process crashes. This is easier to see on bigger Yukon servers like Journey by visiting every room, opening every prompt, and visiting as many member igloos as possible to load those textures.

@sky-is-winning
Copy link
Contributor

Addressed in #20.

in RoomFactory.js

for (let item of this.world.loadedAssets) {
    if (Object.keys(this.world.room.textures.list).includes(item.id)) {
        textures++
        this.world.room.textures.remove(item.id)
    }

    if (Object.keys(this.world.cache.json.entries.entries).includes(item.id)) {
        this.world.room.cache.json.remove(item.id)
        json++
    }

    if (Object.keys(this.world.cache.audio.entries.entries).includes(item.id)) {
        this.world.room.cache.audio.remove(item.id)
        audio++
    }

    if (Object.keys(this.world.cache.video.entries.entries).includes(item.id)) {
        this.world.room.cache.video.remove(item.id)
    }

    for (let anim in this.world.room.anims.anims.entries) {
        if (this.world.room.anims.anims.entries[anim].frames[0].textureKey == item.id || this.world.room.anims.anims.entries[anim].key.startsWith(item.id)) {
            anims++
            delete this.world.room.anims.anims.entries[anim]
        }
    }
}

This is run at the start of room loading, meaning the first thing we do is unload every asset loaded whilst we were in the previous room. This includes the room's assets, as well as assets of any widgets we may have loaded when in that room, and clothing sprites from any penguins that were in that room.

Memory usage could be reduced further by unloading any asset once it is no longer in use, rather than just checking when the room is unloaded. This would only make a difference when you have a lot of penguins in a room changing clothing items regularly, meaning many many items are loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants