Package org.apache.sysds.runtime.ooc.memory

# Class SyncMemoryAllowance

java.lang.Object
org.apache.sysds.runtime.ooc.memory.SyncMemoryAllowance

All Implemented Interfaces:
  `MemoryAllowance`

Direct Known Subclasses:
  `CachedAllowance`

public class SyncMemoryAllowance extends Object implements MemoryAllowance

## Constructor Summary

Constructors
Constructor
Description
`SyncMemoryAllowance(MemoryBroker broker)`
`SyncMemoryAllowance(MemoryBroker broker, long consumptionLimit)`
`SyncMemoryAllowance(MemoryBroker broker, long consumptionLimit, long minimumOperatingBytes)`

## Method Summary

Modifier and Type
Method
Description
`long`
`getGrantedMemory()`
`long`
`getTargetMemory()`
`long`
`getUsedMemory()`
`boolean`
`isShutdown()`
`void`
`release(long bytes)`
`OOCFuture<Void>`
`reserveAsync(long bytes)`
`void`
`reserveBlocking(long bytes)`
`void`
`setTargetMemory(long targetMemory)`
`void`
`shutdown()`
`boolean`
`tryReserve(long bytes)`

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

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

### Methods inherited from interface org.apache.sysds.runtime.ooc.memory.MemoryAllowance

`destroy, getFreeMemory, isUnderPressure`

## Constructor Details

### SyncMemoryAllowance

public SyncMemoryAllowance(MemoryBroker broker)

### SyncMemoryAllowance

public SyncMemoryAllowance(MemoryBroker broker, long consumptionLimit)

### SyncMemoryAllowance

public SyncMemoryAllowance(MemoryBroker broker, long consumptionLimit, long minimumOperatingBytes)

## Method Details

### tryReserve

public boolean tryReserve(long bytes)

Specified by:
  `tryReserve` in interface `MemoryAllowance`

### reserveBlocking

public void reserveBlocking(long bytes)

Specified by:
  `reserveBlocking` in interface `MemoryAllowance`

### reserveAsync

public OOCFuture<Void> reserveAsync(long bytes)

Specified by:
  `reserveAsync` in interface `MemoryAllowance`

### release

public void release(long bytes)

Specified by:
  `release` in interface `MemoryAllowance`

### getUsedMemory

public long getUsedMemory()

Specified by:
  `getUsedMemory` in interface `MemoryAllowance`

### getGrantedMemory

public long getGrantedMemory()

Specified by:
  `getGrantedMemory` in interface `MemoryAllowance`

### getTargetMemory

public long getTargetMemory()

Specified by:
  `getTargetMemory` in interface `MemoryAllowance`

### setTargetMemory

public void setTargetMemory(long targetMemory)

Specified by:
  `setTargetMemory` in interface `MemoryAllowance`

### shutdown

public void shutdown()

Specified by:
  `shutdown` in interface `MemoryAllowance`

### isShutdown

public boolean isShutdown()

Specified by:
  `isShutdown` in interface `MemoryAllowance`