Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
None
-
None
-
None
Description
The current memory estimate of leftindexing operations is incorrect (in terms of a dangerous underestimation that leads to OOMs) for empty input matrices in loops. For example, consider the following script
R = matrix(0, N, r^2); parfor(i in 1:nrow(X)) { Xi = X[i,] R[i,] = matrix(t(Xi)%*%Xi, 1, ncol(X)^2) }
In this scenario, the memory estimate of R[i,] is mistakenly set to a single row, which is only valid during dynamic recompilation with constant indexing range quantifiers.