public final class MemoryLimiter extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
TOTAL_CLAIMABLE_MEMORY_SIZE_MB |
| Constructor and Description |
|---|
MemoryLimiter() |
public long claim(long toClaimMb)
throws RejectRequestException
toClaimMb - The amount of memory the request wishes to claim. (In Megabytes)release(long) when the request exits.RejectRequestException - If the request should be rejected because it could not be given
the resources requested.public void release(long ammountUsed)
ammountUsed - the number returned from claim(long) when the request began. (Note that
this is NOT the value that was passed to claim.)Copyright © 2015 Google. All rights reserved.