boinc icon indicating copy to clipboard operation
boinc copied to clipboard

Force working set size when project does not correctly set

Open Toby-Broom opened this issue 3 years ago • 13 comments

Describe the problem image Since the max number of jobs is 8 and I have a 28 core machine it leaves the computer somewhat unloaded, if I don't set unlimited. As a work around I put 1TB of memory in my computer.

In the BOINC client this job is reported as needing 9.96 GB of memory even though it only uses ~2.5 GB image image

Describe the solution you'd like I could set the cmdline XML element to force a lower quantity of memory and this would be passed to the client?

e.g. <app_version> <cmdline>--memory_size 2.5 GB</cmdline> </app_version>

but the client doesn't know about this.

There could be a new XML element for memory?

I could also write a script to edit the job file e.g.

foreach ($workunit in $ClientS.client_state.workunit){

If ($workunit.app_name -eq "ATLAS"){$workunit.rsc_memory_bound = (2.5gb).tostring() + ".000000"} }

but I would prefer that I could more readily set it via a config etc.

Toby-Broom avatar Aug 13 '22 18:08 Toby-Broom

I don't understand the problem; please clarify.

davidpanderson avatar Aug 13 '22 19:08 davidpanderson

I added some pictures.

Maybe also there is some issues with Max # of jobs / Max # CPUs since only when both are set to unlimited does BOINC "store at least" n days of work.

Toby-Broom avatar Aug 13 '22 20:08 Toby-Broom

The code (app.cpp) has if (atp->app_version->is_vm_app) { // the memory of virtual machine apps is not reported correctly, // at least on Windows. Use the VM size instead. // pi.working_set_size_smoothed = atp->wup->rsc_memory_bound; } else {

... which is the source of this problem.

So we need to figure out

  1. do OSs other than Windows report VM mem usage correctly?
  2. has the problem been fixed on Windows since this code was written?

davidpanderson avatar Aug 13 '22 22:08 davidpanderson

A CMS task reports less image

So it reflects the values in the client_state.xml

CMS = 3000000000 Theory = 700000000 ATLAS = 10695475200

If you force another number in appconfig then it doesn't override

I can check on linux

Toby-Broom avatar Aug 13 '22 23:08 Toby-Broom

I changed my Max # CPUs to 1, so the working set in client state is 4089446400 but BOINC now has no work buffer, when one job/task is completed then it gets one.

waiting for Linux machine to get some new tasks

Toby-Broom avatar Aug 14 '22 09:08 Toby-Broom

Here is default on Linux image and with --memory_size_mb 3900 image

Since it seems that starting a new task is based on WS size then it won't start a new job since client thinks there is no free memory

Toby-Broom avatar Aug 14 '22 11:08 Toby-Broom

On windows the VM size is wrong due to the way the kernel handles virtualization, the true ram usage is in private data not in the image size image

Toby-Broom avatar Aug 14 '22 11:08 Toby-Broom

Is there a way to get the RAM usage on Windows?

davidpanderson avatar Aug 14 '22 20:08 davidpanderson

I can check this

AenBleidd avatar Aug 14 '22 20:08 AenBleidd

Something like this? https://www.codeproject.com/Articles/87529/Calculate-Memory-Working-Set-Private-Programmatica

https://stackoverflow.com/questions/866202/in-c-win32-app-how-can-i-determine-private-bytes-working-set-and-virtual-size

Toby-Broom avatar Aug 14 '22 21:08 Toby-Broom

The 2nd link looks promising.

davidpanderson avatar Aug 15 '22 00:08 davidpanderson

So if the VM size is fixed then it would start new work based on the delta of free memory vs VM size? now it seems to do based on WS size which is wrong from project

Toby-Broom avatar Aug 15 '22 17:08 Toby-Broom

@davidpanderson did you fix this? in 7.20.2 I have:

image

Toby-Broom avatar May 31 '23 20:05 Toby-Broom