org.apache.sysds.utils

## Class MemoryEstimates

- java.lang.Object
- - org.apache.sysds.utils.MemoryEstimates

-     public class MemoryEstimates
      extends Object

  Memory Estimates is a helper class containing static classes that estimate the memory requirements of different types of objects in java. All estimates are worst case JVM x86-64bit uncompressed object pointers. This in practice means that the objects are most commonly smaller, for instance the object references are often time. If the memory pressure is low (there is a low number of allocated objects) then object pointers are 4 bits.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemoryEstimates()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `bitSetCost(int length)` Get the worst case memory usage of an java.util.BitSet java object.
    `static long` | `byteArrayCost(int length)` Get the worst case memory usage of an array of bytes.
    `static long` | `charArrayCost(int length)` Get the worst case memory usage of an array of chars.
    `static double` | `doubleArrayCost(long length)` Get the worst case memory usage of an array of doubles.
    `static double` | `intArrayCost(long length)` Get the worst case memory usage of an array of integers.
    `static double` | `longArrayCost(int length)` Get the worst case memory usage for an array of longs
    `static double` | `objectArrayCost(long length)` Get the worst case memory usage for an array of objects.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MemoryEstimates

          public MemoryEstimates()

  - ### Method Detail

    - #### bitSetCost

          public static long bitSetCost(int length)

      Get the worst case memory usage of an java.util.BitSet java object.
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

    - #### byteArrayCost

          public static long byteArrayCost(int length)

      Get the worst case memory usage of an array of bytes.
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

    - #### charArrayCost

          public static long charArrayCost(int length)

      Get the worst case memory usage of an array of chars.
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

    - #### intArrayCost

          public static double intArrayCost(long length)

      Get the worst case memory usage of an array of integers.
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

    - #### doubleArrayCost

          public static double doubleArrayCost(long length)

      Get the worst case memory usage of an array of doubles.
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

    - #### objectArrayCost

          public static double objectArrayCost(long length)

      Get the worst case memory usage for an array of objects.
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

    - #### longArrayCost

          public static double longArrayCost(int length)

      Get the worst case memory usage for an array of longs
      Parameters:
        `length` - The length of the array.
      Returns:
        The memory estimate in bytes

Copyright © 2021 The Apache Software Foundation. All rights reserved.