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

loaders.gl/las OOM Error #1912

Closed
gchoqueux opened this issue Nov 3, 2021 · 9 comments
Closed

loaders.gl/las OOM Error #1912

gchoqueux opened this issue Nov 3, 2021 · 9 comments

Comments

@gchoqueux
Copy link

gchoqueux commented Nov 3, 2021

We use loaders.gl/las to load a large cloud with a multitude of laz files (entwine cloud).
Then we visualize them simultaneously from hundreds of laz files with a library THREE.js.

After uploading hundreds of files, the loaders.gl/las throwns OOM Error.
It seems that this error is thrown when emscripten can't resize memory heap.

Is there a memory leak?
Is there a memory limit?
is possible to free the loaders.gl/las memory?

We have a open issue iTowns/itowns#1721

@ibgreen
Copy link
Collaborator

ibgreen commented Nov 3, 2021

If you are using the default setup, you are probably using the worker loader.

You can set a flag to destroy the worker loader after each load: https://loaders.gl/docs/developer-guide/using-worker-loaders#disabling-reuse-of-workers. Perhaps using a fresh loader for each load will help?

@gchoqueux
Copy link
Author

gchoqueux commented Nov 3, 2021

Thank you for the answer.

I don't use the load method, I use directly the parser with the method LASLoader.parse.
The options worker and reuseWorkers are used in the parser?

@ibgreen
Copy link
Collaborator

ibgreen commented Nov 3, 2021

No you would need to use load() or parse().

@gchoqueux
Copy link
Author

gchoqueux commented Nov 4, 2021

The parse() method fixes the OOM error, with options { worker: true, reuseWorkers: false }
But they are replaced by warnings from las-worker.js :

  • On Chrome : Invalid asm.js: Unexpected token
  • On Firefox : asm.js type error: expecting argument type declaration for 'n' of the form 'arg = arg|0' or 'arg = +arg' or 'arg = fround(arg)' las-worker.js:1:62997

Of course, the warnings disappear if worker: false.

@ibgreen
Copy link
Collaborator

ibgreen commented Nov 4, 2021

Haven't seen these. The LASLoader appears to work on the loaders.gl website: https://loaders.gl/examples/pointcloud (and I can see the las worker has started in the Thread inspector).

Are these just warnings? Do the point clouds actually load?

Not sure how to help...

Screen Shot 2021-11-04 at 6 51 14 AM

@gchoqueux
Copy link
Author

Yes, the point cloud files are loaded with parse(data, LASLoader, { worker: true, reuseWorkers: false }) and worker has started.

As I load thousands of files, I get thousands of asm/worker warnings.

@ibgreen
Copy link
Collaborator

ibgreen commented Nov 29, 2021

@gchoqueux Sorry for slow reply.

In contrast to most loaders.gl loaders, the LAS loader is just a wrapper around a pre-compiled asm.js file (presumably the original source code is in C++). See https://github.com/verma/plasio.

I will close this issue as unfortunately, I do not have a lot of knowledge about asm.js and browser differences related to that.

I can say that long-term it would be very desirable to move to a pure Javascript (Typescript) LAS loader implementation. That would make this important loader much easier to maintain.

@ibgreen ibgreen closed this as completed Nov 29, 2021
@gchoqueux
Copy link
Author

ok, thanks

@greenwood-vaarst
Copy link

greenwood-vaarst commented Aug 17, 2022

@gchoqueux did you ever resolve this? I'm having the same issue

ignore me, parse(data, LASLoader, { worker: true, reuseWorkers: false }) worked for me as well, with no warnings...

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

3 participants