Did some improvements

This commit is contained in:
Shoghi Cervantes Pueyo
2013-01-15 19:25:33 +01:00
parent 4ddb8a298b
commit fe7595e313
7 changed files with 25 additions and 12 deletions

View File

@@ -235,8 +235,13 @@ class ServerAPI{
private function loadProperties(){
if($this->getProperty("memory-limit") !== false){
@ini_set("memory_limit", $this->getProperty("memory-limit"));
if(($memory = $this->getProperty("memory-limit")) !== false){
$value = array("M" => 1, "G" => 1024);
$real = ((int) substr($memory, 0, -1)) * $value[substr($memory, -1)];
if($real < 128){
console("[ERROR] PocketMine doesn't work right with less than 128MB of RAM", true, true, 0);
}
@ini_set("memory_limit", $memory);
}else{
$this->setProperty("memory-limit", "256M");
}