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

Spine-player IOS 15.5 disposing player memory issues #2355

Open
Futekov3216 opened this issue Aug 31, 2023 · 10 comments
Open

Spine-player IOS 15.5 disposing player memory issues #2355

Futekov3216 opened this issue Aug 31, 2023 · 10 comments
Assignees
Labels

Comments

@Futekov3216
Copy link

Memory is not disposed with dispose() method on IOS 15.5

@HaraldCsaszar
Copy link
Collaborator

@Futekov3216 Which runtime are you using?

@Futekov3216
Copy link
Author

We have done the tests using spine-player/exmple/dispose.html and just separated the dispose and creating of the spine

image

@HaraldCsaszar
Copy link
Collaborator

Thanks for the info, so you're using spine-ts/spine-player.
https://github.com/EsotericSoftware/spine-runtimes/tree/4.1/spine-ts/spine-player

@Futekov3216
Copy link
Author

Yes this is the runtime

@badlogic
Copy link
Collaborator

How do you determine the issue? The SpinePlayer.dispose() method does indeed do all the things necessary for the browser to be able to deallocate the underlying native resources, like WebGL shaders/textures and so on, and any event listeners that may hold on to references to other things.

What SpinePlayer.dipose() can not guarantee is when the browser actually garbage collects those things. E.g. in Chrome, the GC is pretty aggressive and will happily kill things pretty quickly. Firefox is a little less agressive and has an upper memory limit when it starts collecting (on the desktop).

For Safari on macOS and iOS, the profiling tools aren't great. I can record memory and JS allocation timelines, but those usually don't work.

Are you using those to analyse memory usage? What do you see? If not, how else do you determine that there's a problem?

@badlogic
Copy link
Collaborator

badlogic commented Sep 5, 2023

@Futekov3216 happy to reopen if you provide more info.

@badlogic badlogic closed this as completed Sep 5, 2023
@Futekov3216
Copy link
Author

i am providing 2 screenshots of 4 iterations of disposing and initializing the Spine . The phones are Iphone X with iOS-15.5 and iphone X with iOS 16.6. The15.5 version is continuously increasing the memory no matter that we are disposing the spine.

iOS - 15.5

Memory-Usage-iOS-15 5

iOS - 16.6

Memory-Usage-iOS-16 6

@nikola-mrnv
Copy link

We have the same issue. It would be nice to have a solution or some sort of workaround for iOS 15.5.

@badlogic badlogic reopened this Sep 8, 2023
@badlogic
Copy link
Collaborator

badlogic commented Sep 8, 2023

Thanks for the additional info. On our end, we do "release" all resources (shaders, buffers) properly, so this might be a Safari bug. I'll investigate.

@badlogic badlogic self-assigned this May 6, 2024
@badlogic badlogic added the bug label May 6, 2024
@deemonrider
Copy link

I do have the same issue on IOS 17.5. I use vue and when I switch between the menus the spinePlayer gets disposed and in the new scene created again. After some switches the browser just crashes.

I also use the plain spine-webgl to render my spine animations and I experience the issue there too and therefore we would need to investiage there further.

On all other devices (Windows & IpadOS) it works and I don't experience crashes.

I agree that it is an Safari bug (https://bugs.webkit.org/show_bug.cgi?id=268071) but I do think that there might be a workarround by adjusting the implementation. Might be worth it to take a look at other repos:
cornerstonejs/cornerstone3D#1212

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

No branches or pull requests

5 participants