erich666 / Mineways

Exports models from Minecraft for 3D printing or rendering
http://mineways.com
Other
408 stars 59 forks source link

Memory usage problem #83

Closed LySoon closed 3 years ago

LySoon commented 3 years ago

Even if i download the latest version im still having trouble with exporting my "dragon" world its a 3000 x 3000 map, last night i was able to export another 3000x3000 world with no issue but sometimes it just stucks and keeps giving me out of memory error even tho i mark the "give more export memory" option.

Can you please remove the button and make it always use all memory? i can't understand why it does.. World version is 1.12.2 and it still giving the same error. (World is not even opened by a player its a world painter export)

And if you ask why you need such huge exports : im a freelancer and working as a terraformer so i need my maps to be rendered to shown in my portfolio here is a example firstrenderx3

System Specs : image

erich666 commented 3 years ago

The "give me more memory" option does this: it unloads all chunks loaded by the mapping portion of the Mineways program whenever you do an export. During export then only the chunks being exported are reloaded. This allows a bit of memory to be freed up for other uses during export, though not a lot. The reason this is not on by default is that it slows the program down - chunks are unloaded and then reloaded.

I suggest you export sections of your world and then read each in to whatever rendering program you're using. That is, instead of one huge file, export say a 2x2 grid of your world, four files. This is easily done with scripts, see the second example here: https://www.realtimerendering.com/erich/minecraft/public/mineways/scripting.html#uie - just give the bounds for each export, turn off model centering (so that the models will properly align when read in by your program), and read in the script using "File | Import settings". A 10-line script is all you need.

All this said, I do see one way I could save some memory for each chunk, which I hope to implement next week for version 9.00. So, I'll keep this issue open and note if and when I implement this feature.

LySoon commented 3 years ago

Thanks for caring my suggestion <3

erich666 commented 3 years ago

I should mention that version 9.00 has improved memory usage. Also, the "give me more memory" option is even more aggressive now, as it tries to trim the size of every chunk. As noted in the release notes:

The "Give more export memory!" feature has been further enhanced. When turned on, chunks that are loaded are reduced in storage size, eliminating the blank air storage at the top of each. This storage reduction can result in considerably slower map load times (about 3 times as long). But, overall memory use dropped from 2.8 GB to 1.8 GB for a giant full-screen view of a world.

Anyway, I can always try to do better on memory usage, but the new code should help you out.

LySoon commented 3 years ago

Thanks, that a lot of improvement for ram usage part, and its not that slow i think ^^ <3