Get Memory Limit

@return string
@throws \Exception
6584
protected function getMemoryLimit()
    {
        if (!isset($this->config['mp3']['memoryLimit'])) {
            throw new \Exception(
                $this->translate->translate(
                    'memoryLimit is not currently set',
                    'mp3'
                )
            );
        }

        return $this->config['mp3']['memoryLimit'];
    }
1104588
public function getMemoryUsage()
    {
        if (empty($this->endMemory)) {
            $this->stop();
        }

        return $this->getFormattedMemorySize($this->endMemory - $this->startMemory);
    }
128946
public function getMaxChunks()
	{
		return ceil(mb_strlen((string) $this->text, $this->encoding) / $this->size);
	}
148925
protected function checkMemory()
    {
        // We will only check, if we were able to determine a memory limit
        // in the first place.
        if ($this->serverMemoryLimit > 2) {
            $left = $this->serverMemoryLimit - memory_get_usage();
            // Is more left than is configured?
            if ($left < $this->minMemoryLeft) {
                $this->pool->messages->addMessage('emergencyMemory');
                // Show settings to give the dev to repair the situation.
                Krexx::editSettings();
                Krexx::disable();
                static::$allIsOk = false;
                return true;
            }
        }

        return false;
    }
532505
public function getMaxUploadSize()
    {
        $maxUpload = (int)(ini_get('upload_max_filesize'));
        $maxPost = (int)(ini_get('post_max_size'));
        $memoryLimit = (int)(ini_get('memory_limit'));
        return min($maxUpload, $maxPost, $memoryLimit);
    }
165183
private function maxLength()
	{
		$max = mb_strlen($this->value);
		if (!$ret = $max <= $this->options->max) {
			$this->error(1);
		}

		return $ret;
	}
278284
public function getLimit($max = null)
    {
        $limit = $this->getPage('limit') ?: $this->getPage('size') ?: null;

        if ($limit && $max) {
            $limit = min($max, $limit);
        }

        return $limit;
    }
897315
protected function fetchLimits()
    {
        $result = $this->get('/rate_limit') ?: [];

        // Assemble Limit instances
        foreach ($result['resources'] as $resourceName => $resource) {
            $this->resources[$resourceName] = new RateLimitResource($resourceName, $resource);
        }

        return $result;
    }
269245
public function limit() 
    {
        $url = self::HOST . self::LIMIT;

        $params = $this->get_default_params();
        $result = $this->request($url, $params);
        $result = explode("\n", $result);

        return array(
            'code' => $result[0],
            'total' => $result[1],
            'current' => $result[2]
        );
    }
307265
public function getRam()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Memory');
        }

        $total_memory = 0;
        $free_memory = 0;

        foreach ($this->wmi->ExecQuery('SELECT TotalPhysicalMemory FROM Win32_ComputerSystem') as $cs) {
            $total_memory = $cs->TotalPhysicalMemory;
            break;
        }

        foreach ($this->wmi->ExecQuery('SELECT FreePhysicalMemory FROM Win32_OperatingSystem') as $os) {
            $free_memory = $os->FreePhysicalMemory;
            break;
        }

        return array(
            'type' => 'Physical',
            'total' => $total_memory,
            'free' => $free_memory * 1024,
        );
    }
107417
public function getFillingPercentage()
    {
        $mem = apc_sma_info(true);
        $memSize    = $mem['num_seg'] * $mem['seg_size'];
        $memAvailable= $mem['avail_mem'];
        $memUsed = $memSize - $memAvailable;
        if ($memSize == 0) {
            Zend_Cache::throwException('can\'t get apc memory size');
        }
        if ($memUsed > $memSize) {
            return 100;
        }
        return ((int) (100. * ($memUsed / $memSize)));
    }
509846
private function getPaginationLimitNode()
    {
        /** @var Query $rqlQuery */
        $rqlQuery = $this->request->attributes->get('rqlQuery');

        if ($rqlQuery instanceof Query && $rqlQuery->getLimit() instanceof LimitNode) {
            return $rqlQuery->getLimit();
        }

        return false;
    }
282562
protected function _limit()
	{
		$limit = $this->getLimit();
		if ($limit !== null) {
			$i = 0;
			$_tagsArray = array();
			foreach ($this->_tagsArray as $key => $value) {
				if ($i < $limit) {
					$_tagsArray[$value['tag']] = $value;
				}
				$i++;
			}
			$this->_tagsArray = array();
			$this->_tagsArray = $_tagsArray;
		}
		return $this->_tagsArray;
	}
782615
private function _memory()
    {
        $mems = "";
        $tswap = "";
        $pswap = "";
        foreach ($this->readaixdata() as $line) {
            if (preg_match("/^Good Memory Size:\s+(\d+)\s+MB/", $line, $ar_buf)) {
                $mems = $ar_buf[1];
            }
            if (preg_match("/^\s*Total Paging Space:\s+(\d+)MB/", $line, $ar_buf)) {
                $tswap = $ar_buf[1];
            }
            if (preg_match("/^\s*Percent Used:\s+(\d+)%/", $line, $ar_buf)) {
                $pswap = $ar_buf[1];
            }
        }
        if (trim($mems) != "") {
            $mems = $mems*1024*1024;
            $this->sys->setMemTotal($mems);
            $memu = 0;
            $memf = 0;
            if (CommonFunctions::executeProgram('svmon', '-G', $buf)) {
                if (preg_match("/^memory\s+\d+\s+(\d+)\s+/", $buf, $ar_buf)) {
                    $memu = $ar_buf[1]*1024*4;
                    $memf = $mems - $memu;
                }
            }
            $this->sys->setMemUsed($memu);
            $this->sys->setMemFree($memf);
//            $this->sys->setMemApplication($mems);
//            $this->sys->setMemBuffer($mems);
//            $this->sys->setMemCache($mems);
        }
        if (trim($tswap) != "") {
            $dev = new DiskDevice();
            $dev->setName("SWAP");
            $dev->setFsType('swap');
            $dev->setTotal($tswap * 1024 * 1024);
            if (trim($pswap) != "") {
                $dev->setUsed($dev->getTotal() * $pswap / 100);
            }
            $dev->setFree($dev->getTotal() - $dev->getUsed());
            $this->sys->setSwapDevices($dev);
        }
    }
416672
protected function getLimit()
    {
        $limit = $this->activeState()->getLimit();
        if (!in_array($limit, $this->limits)) {
            //We are using lowest limit by default
            return $this->limits[0];
        }

        return $limit;
    }
87186
protected function buildLimit()
    {
        return $this->limit !== null ? ' LIMIT ' . $this->limit . ($this->offset ? ' OFFSET ' . $this->offset : '') : '';
    }
1184100
public function getFullLength()
    {
        $cmd_length = 1;

        $rl_length = strlen($this->remaining_length_bytes);

        return $cmd_length + $rl_length + $this->remaining_length;
    }