Github user dbtsai commented on a diff in the pull request: https://github.com/apache/spark/pull/15628#discussion_r107963752 --- Diff: mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala --- @@ -1079,4 +1267,15 @@ object Matrices { SparseMatrix.fromCOO(numRows, numCols, entries) } } + + private[ml] def getSparseSize(numActives: Long, numPtrs: Long): Long = { + // 8 * values.length + 4 * rowIndices.length + 4 * colPtrs.length + 12 + 12 + 12 + 1 + 12L * numActives + 4L * numPtrs + 37L + } + + private[ml] def getDenseSize(numCols: Long, numRows: Long): Long = { + // 8 * values.length + 12 + 1 --- End diff -- Can you document what is the magical number `12 + 1`? Also, can we make it `java.lang.Double.BYTES * numCols * numRows + 13L` since the size of primitive type can depend on the implementation of JVM.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org