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

Calling MeshHandleObject.remove() on a mesh of size ~3.0 MB causes the program to hang #369

Open
bhung-bdai opened this issue Jan 14, 2025 · 2 comments

Comments

@bhung-bdai
Copy link

Hi,

I've noticed that calling the MeshHandleObject.remove() function on larger sized meshes (in this case, around 3 MB) is causing the program to hang. As part of my code, I have a function which resets the visualizer by calling SceneNodeHandleInheritedObject.remove() on each handle in the scene. It deletes things like sliders, buttons, and small meshes fine but stalls out when it comes to deleting the bigger mesh. Is there a solution to make this work? If I am resetting a scene, is there a faster way to do it?

Example of stalling. The below has 26 SceneNodeHandles but only gets to deleting 16 of them:
image

Notable, when I CTRL-C it, it interrupts this deletion and continues to to delete as expected.

I've gotten around the problem at the moment by not deleting MeshHandle types since it seems to be reset when when the Scene is reset anyways, but I'm not sure if this is the right solution. Any pointers?

@bhung-bdai
Copy link
Author

bhung-bdai commented Jan 14, 2025

As a follow up: I have reason to believe this was a race condition. If the element removal is asynchronous, there might have been a case where I was removing the mesh and then removing it again before it was properly deleted. This may also be fixed in later versions, which I haven't been able to test. As a result I don't think this is that much of an issue.

@brentyi
Copy link
Collaborator

brentyi commented Jan 14, 2025

Okay, thanks for the update!

I haven't seen this particular issue, but if you're able to make a reproducible example I could debug it. Perhaps this is hard if it's a race condition problem, though.

As an additional note the newer versions of viser will take async callback functions that are run in viser's main event loop (by default they are run from a thread pool). This might help with race conditions.

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