% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_conversion.R
\name{object_size}
\alias{object_size}
\title{Get memory size of HDF5Matrix without loading}
\usage{
object_size(x, unit = c("MB", "bytes", "KB", "GB"))
}
\arguments{
\item{x}{An \code{HDF5Matrix} object}

\item{unit}{Character. Unit for size: "bytes", "KB", "MB", "GB". Default "MB".}
}
\value{
Numeric value with estimated memory size
}
\description{
Estimates how much memory the dataset would occupy if loaded into RAM.
}
\examples{
\donttest{
    fn <- tempfile(fileext = ".h5")
    X <- hdf5_create_matrix(fn, "data/X", nrow = 100, ncol = 50)
    object_size(X)
    object_size(X, unit = "KB")
    hdf5_close_all()
    unlink(fn)
}

}
