public function percentUsage()
    {
        $total = $this->systemTotal();
        $free  = $this->systemFree();

        $usage = [];

        foreach( $total as $slotId => $amount ) {
            $usage[ $slotId ] = intval( ceil( ( ( $amount - $free[ $slotId ] ) * 100 ) / $amount ) );
        }

        return $usage;
    }
public function percentUsage()
    {
        $total = $this->systemTotal();
        $free  = $this->systemFree();

        $usage = [];

        foreach( $total as $slotId => $amount ) {
            $usage[ $slotId ] = intval( ceil( ( ( $amount - $free[ $slotId ] ) * 100 ) / $amount ) );
        }

        return $usage;
    }
public function percentUsage ( ) { $ total = $ this -> systemTotal ( ) ; $ free = $ this -> systemFree ( ) ; $ usage = [ ] ; foreach ( $ total as $ slotId => $ amount ) { $ usage [ $ slotId ] = intval ( ceil ( ( ( $ amount - $ free [ $ slotId ] ) * 100 ) / $ amount ) ) ; } return $ usage ; }
Percentage of memory used per slot

@return array Integer percentage of memory used
Percentage of memory used per slot