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

Running Out Of Memory #65

Open
keerl opened this issue Jan 6, 2023 · 5 comments
Open

Running Out Of Memory #65

keerl opened this issue Jan 6, 2023 · 5 comments

Comments

@keerl
Copy link

keerl commented Jan 6, 2023

I am trying to run this on a computer with limited resources and I keep getting crashes because I run out of memory. I saw the arg called max_cells_for_memory_only which from what I understand will use a temp file instead of memory if the cells are bigger than that value. I set that value to 0 so it will always use temp files. When I run something I see it get into the expected if statements for the temp file stuff but when I watch the memory usage of the process it still goes way up, almost to 1 gig in my example.

Is there something else I have to do to disable in-memory processing?

@ChHarding
Copy link
Owner

ChHarding commented Jan 9, 2023 via email

@keerl
Copy link
Author

keerl commented Jan 10, 2023

Thanks for the response. I've been looking over the code and experimenting with this over the last few days. I'm running this directly from Python on a computer that has limited resources. I found that the memory issue is with the construction of the grid (which contains the memory allocated for all cell, quad, and vertex).

My idea to fix this was to combine multiple steps together. Currently, it constructs the grid, then gets all the triangles from the grid, then starts writing the STL. I saw no reason that these steps can't be combined together so that the STL gets written (in fixed sized chunks) as the grid is constructed. I hacked together a version that was able to do that and it seems to be working well. I was able to create a large STL (100Mb) on a computer that has 512Mb of memory.

My code is nowhere near PR worthy but I just wanted to let you know that this route is possible and has a major memory reduction.

@ChHarding
Copy link
Owner

ChHarding commented Jan 10, 2023 via email

@keerl
Copy link
Author

keerl commented Jan 15, 2023

I messed around with it a bit more and got it working for STLa and STLb but not OBJ quite yet. I cleaned it up slightly. I put it as a PR so you can easily see the DIFF. #66

@ChHarding
Copy link
Owner

ChHarding commented Jun 9, 2023 via email

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