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

Subdivide tasks to prevent Luajit OOM #122

Open
Fixer-007 opened this issue Oct 13, 2016 · 3 comments
Open

Subdivide tasks to prevent Luajit OOM #122

Fixer-007 opened this issue Oct 13, 2016 · 3 comments

Comments

@Fixer-007
Copy link

Sometimes If you are doing something big with worldedit you may end up with luajit OOM, I wonder if it is possible for worldedit to divide big tasks into smaller ones to avoid OOMs... (like dividing big volume into smaller chunks and processing each one - one by one).

@Fixer-007
Copy link
Author

Or use nonluajit version instead :/

@9joshua
Copy link

9joshua commented Jun 2, 2017

+1

If we know luajit can only handle say 50000 nodes then a selection of 1000000 could be saved into 20 temporary files and then concatenated into a single file. This fearture would be sooooo nice.

Using a non luajit version would only give you 4x the area. @Fixer-007's original solution would give you an essentially unlimited area save size. Perhaps the only limit is that the concatenated file must be less than 1GB.

@sbrl
Copy link
Contributor

sbrl commented Feb 7, 2021

Just seen this while browsing the issues here. I've implemented a //subdivide command in my WorldEditAdditions mod which I have successfully tested on areas of 2000x150x2000 (~600 million nodes).

The documentation for the command can be found here: https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#subdivide-size_x-size_y-size_z-cmd_name-args

I'm still tweaking and refining it, but it seems pretty stable. I'm currently chasing down an issue whereby it gets stuck a random percentage of the way through, but it seems that this only occurs in low-resource environments (i.e. on a Raspberry Pi 3B+. So long as you have plenty of RAM it should work fine.

In short, use the command like so:

///subdivide 10 10 10 clearcut

This would run //clearcut in 10x10x10 chunks over the defined region. //subdivide is saferegion aware, so it handles large chunks properly. If your goal is for it to complete in the lowest amount of time possible, I recommend larger chunk sizes. It is also async, so you can execute other commands at the same time (though chunkloading is extremely slow while //subdivide is running.

@sfan5 sfan5 changed the title Preventing Luajit OOM Subdivide tasks to prevent Luajit OOM May 26, 2024
@sfan5 sfan5 added feature request and removed bug labels May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants