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

[FEATURE REQUEST] Anyway to calculate how much RAM you need ? #953

Open
MasterCATZ opened this issue Dec 13, 2024 · 8 comments
Open

[FEATURE REQUEST] Anyway to calculate how much RAM you need ? #953

MasterCATZ opened this issue Dec 13, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@MasterCATZ
Copy link

Is your feature request related to a problem?

I have 128gb RAM and kept getting OOM ,
within minutes UVtools would be over 90gb Used and had to close down everything else for UVtools to not crash my desktop

Ubuntu user , multiple times UVTools would just cause entire desktop to reload , (while hollowing / adding infill)
can their be some sort of guard against this ? why can the program not kill its self ?
using UVtools.AppImage

Currently deciding with going 512gb 3200mhz RAM and 1tb 2400mhz RAM

as much as I would love having 1Tb for it to be cost effective I would be taking a 28% performance hit
I rather not spend more than $1500 on more memory
if I knew 512gb would not have a chance of OOM'ing I would rather go that route so my data scrubs are not slowed down
but if UVtools is going to be another memory hog contender with chrome I guess i will jut have to increase the budget

so is their some calculation that can be done based on layers and dimensional size to work out memory usage ?

I was using working with ~250x250x250mm @50um and I can do ~900x900x300mm @25um

Describe the solution you'd like

Program to kill itsself if a set memory usage threshold is reached

Files

No response

@MasterCATZ MasterCATZ added the enhancement New feature or request label Dec 13, 2024
Copy link

This is your first time submitting an issue with UVtools 🥳Please review your issue and ensure that the submit template was followed, the information is complete, and not related to any other open issue. It will be reviewed shortly. Debugging is very important and make the program better. Thanks for contributing and making the software better! 🙌

@sn4k3
Copy link
Owner

sn4k3 commented Dec 16, 2024

You have a ton of cores, is that 128 the total or it doubles with hyperthreading?
Note that by default UVtools will spawn a task per core, meanwhile if task is late or there are free tasks it will spawn a bit more to compensate. That of course require a lot of ram. Most of operations will take more than a bitmap, sometime three or more bitmap in issue detection. Some memory are only free latter (Not just after task ends).
If by any chance there are a memory leak your system will be killed easy.

My advice is to cut workload in half on UVtools settings, start with 1/2, monitor ram and tune from there.

You can also attach a file here and tell the workflow so I can check it.
Infill operation does take alot of ram...

UVtools is going to be another memory hog contender with chrome

Chrome has no chance here 😁

Program to kill itsself if a set memory usage threshold is reached

I think it's possible to add a limiter that cancels the current operation (If supported)

@sn4k3
Copy link
Owner

sn4k3 commented Dec 18, 2024

Implemented a limiter, please test it.

@Hargrim
Copy link

Hargrim commented Dec 30, 2024

Implemented a limiter, please test it.

I'm not the OP, but I have an issue with this feature. I have 32GB of ram.

The limiter is killing my UVTools app when trying to drill through multiple selected Suction Cups with below error:

image

It is working if I click suction cups one by one and drill them, but selecting 10 at once and clicking drill on all of them crashes the app.

Would it be possible to add 3rd dropdown option to settings that would restore how UVTools was working a few version back? Like 'do nothing' option in the dropdown? Currently there is only Pause and Cancel.

image

Text of the error:

System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (Your system memory RAM hit the limit of 31.7GB from a total of 31.93GB.  Available: 0.23GB.  UVtools: 14.82GB (46.41%).
The program crashed on purpose due the impossibility to pause or cancel the running operation, this was to relief pressure and ensure the system stability.

Monitor your memory RAM under the system tools and re-run the operation to check the usages and find the cause.
You may need to stop other processes or increase your memory RAM in order to deal with huge files and/or heavy operations.

Currently you have configured a lower limit of 1GB of available memory RAM for the operations.)
 ---> System.InsufficientMemoryException: Your system memory RAM hit the limit of 31.7GB from a total of 31.93GB.  Available: 0.23GB.  UVtools: 14.82GB (46.41%).
The program crashed on purpose due the impossibility to pause or cancel the running operation, this was to relief pressure and ensure the system stability.

Monitor your memory RAM under the system tools and re-run the operation to check the usages and find the cause.
You may need to stop other processes or increase your memory RAM in order to deal with huge files and/or heavy operations.

Currently you have configured a lower limit of 1GB of available memory RAM for the operations.
   at UVtools.UI.MainWindow.<>c__DisplayClass57_0.<RamUsageTimerOnElapsed>b__0() in UVtools.UI\MainWindow.axaml.cs:line 518
   at Avalonia.Threading.DispatcherOperation.InvokeCore()
   --- End of inner exception stack trace ---
Category: Task
File: Magori Ostland DMS MK3 2 — kopia.m5sp  [Version: 518] [Class: AnycubicFile]

Machine date time: 30.12.2024 20:15:23
    UTC date time: 30.12.2024 19:15:2

@sn4k3
Copy link
Owner

sn4k3 commented Dec 30, 2024

@Hargrim This is the excepted and working as it should, the limiter will kill UVtools to prevent system crash as is explained on the text:

The program crashed on purpose due the impossibility to pause or cancel the running operation, this was to relief pressure and ensure the system stability.

This happens to all operations that can't be cancelled or paused, and so the only option is to kill the program. Drill is one of them. I can however try to implement an cancel on that operation. Drill also takes a ton of ram because it need to get many images to scan for pixels up to a void.

@Hargrim
Copy link

Hargrim commented Dec 31, 2024

@sn4k3 Thanks for reply and continuous work on this!

Would it be possible to disable this check from the settings? Or disable it for drilling only via checkbox or something similar?

It was working fine for me before this update, even if it was taking all RAM on my PC. Now I need to right click each suction cup and drill them one by one which is a downgrade and lose of functionality from my POV. Adding cancel option will not improve the situation, I will still need to right click one suction cup after another to drill them, now with added cancel, which will change nothing - if I understand correctly what you are suggesting above.

@sn4k3
Copy link
Owner

sn4k3 commented Dec 31, 2024

Just like any other feature, you can set it to 0 to disable it.

@Hargrim
Copy link

Hargrim commented Dec 31, 2024

Setting it to 0 helped, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants