Recently when doing data analysis, I started having issues with Ubuntu completely freezing: screen stops changing, mouse and keyboard do not respond, and hard drive light does not flash. I have tried waiting up to an hour for the system to unfreeze, but it doesn't and requires a manual reboot.
Looking into this issue, I have been able to reproduce the freezing by filling up the main memory and making the system use swap. For example, in R (with either the terminal or RStudio) I can use the following code to consistently freeze the system:
Code:
x <- replicate(1000000, 1:1000)
I first thought this may be an issue with R, so I ran the same code on Windows 10 (I dual boot on the same computer). On Windows, this code ran for a while, caused some unresponsiveness, and then gracefully stopped with an error:
Code:
> x <- replicate(1000000,1:1000) Error: caot allocate vector of size 3.7 Gb In addition: Waing messages: 1: In array(r, dim = d, dimnames = if (!(is.null(n1 <- names(x[[1L]])) & : Reached total allocation of 8135Mb: see help(memory.size) 2: In array(r, dim = d, dimnames = if (!(is.null(n1 <- names(x[[1L]])) & : Reached total allocation of 8135Mb: see help(memory.size) 3: In array(r, dim = d, dimnames = if (!(is.null(n1 <- names(x[[1L]])) & : Reached total allocation of 8135Mb: see help(memory.size) 4: In array(r, dim = d, dimnames = if (!(is.null(n1 <- names(x[[1L]])) & : Reached total allocation of 8135Mb: see help(memory.size)
برچسب:
نویسنده: استخدام کار