code: public synchronized void take(long bytes) throws ScriptLimitException{
          if(limit>0) {
              memory -= bytes;
              if (memory < 0)
                  throw new ScriptLimitException(ScriptLimitException.Limits.MEMORY, limit);
          }
      }
docs: Takes some bytes from heap
  
  @param bytes
  @throws ScriptLimitException