That’s right, I was running an R process multiplying several large matrices. It filled ram and started swapping. Everything slowed.
I had to kill it.
The task manager looked as follows
That was just after I killed it.
The memory was full and the swap space used was slowly growing
So my 64Gb of physical ram was not nearly enough .
Where can I find a computer with maybe 10x or maybe even 100x that amount of ram?
I know, you are going to tell me to make my matrix algebra more efficient. Tried that… I am not clever enough, or it may be impossible.
I am a strong believer in doing numerical calculations by the simplest direct method, but I got caught out this time.
@nevj
Been fighting lack of ram and # of cpu cores, with LFS!!!
So, in theory, 64G of ram should support 32 cores, do a lscpu and see how many cores the cpu has. I know, Gentoo, you can set # of cores and also # of theards, but if you exceed the ram with # of cores, the cpu will really work hard!!! Maybe you could buy some time with one of NASA super computers!!!
It is an i7 6x… so 6 cores, 12 threads.
It uses all of them. R supports multithreading for matrix operations provided you install the necessary libraries.
I think my best bet is to stop being lazy and look at my matrix algebra and see if I can make it more efficient.
In Python I might try using Polars for the calculations. It does “lazy evaluation” which can speed things up and reduce memory requirements. Your data may not be helped by that though.
Hi Neville,
I think the fact that you have swappiness at 15 is the reason why you don’t use swap much
I kept the swap to an HDD and increase the swapiness to 60. I don’t recommend this value for an SSD, because it writes too much to the swap and the SSD has write limitations.
I reran the large job with 1 trait instead of 2… that should use 1/4 the memory, because I am estimating variances.
It used 42Gb… and did not swap with swappiness=50.
I have 64Gb ram, so it did not need to swap.
In R floating point objects use 8 bytes (64 bits), so that is 42/8=5.2 gig of floating point values. Lots of arithmetic.
I estimate the 2 trait job would have taken 42 x 4 = 168Gb… that would have forced a swap or two. It is feasable to do as @kovacslt suggested and run it overnight. I think I will see if the 1 trait iteration converges first.