MEMORY_GET_USAGE(3) 1 MEMORY_GET_USAGE(3)memory_get_usage - Returns the amount of memory allocated to PHPSYNOPSIS
int memory_get_usage ([bool $real_usage = false])
DESCRIPTION
Returns the amount of memory, in bytes, that's currently being allocated to your PHP script.
PARAMETERS
o $real_usage
- Set this to TRUE to get the real size of memory allocated from system. If not set or FALSE only the memory used by emalloc() is
reported.
RETURN VALUES
Returns the memory amount in bytes.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.2.1 | |
| | |
| | Compiling with --enable-memory-limit is no |
| | longer required for this function to exist. |
| | |
| 5.2.0 | |
| | |
| | $real_usage was added. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
A memory_get_usage(3) example
<?php
// This is only an example, the numbers below will
// differ depending on your system
echo memory_get_usage() . "
"; // 36640
$a = str_repeat("Hello", 4242);
echo memory_get_usage() . "
"; // 57960
unset($a);
echo memory_get_usage() . "
"; // 36744
?>
SEE ALSO memory_get_peak_usage(3), memory_limit.
PHP Documentation Group MEMORY_GET_USAGE(3)
Check Out this Related Man Page
IMAGEPSFREEFONT(3) 1 IMAGEPSFREEFONT(3)imagepsfreefont - Free memory used by a PostScript Type 1 fontSYNOPSIS
bool imagepsfreefont (resource $font_index)
DESCRIPTION imagepsfreefont(3) frees memory used by a PostScript Type 1 font.
PARAMETERS
o $font_index
- A font resource, returned by imagepsloadfont(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
imagepsfreefont(3) example
<?php
// Load a .pfb font file
$font = imagepsloadfont('./bchbi.pfb');
// Do any operations with the font here
// Free the font from memory
imagepsfreefont($font);
?>
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 7.0.0 | |
| | |
| | T1Lib support was removed from PHP, thrus remov- |
| | ing this function. |
| | |
+--------+---------------------------------------------------+
NOTES
Note
This function is only available if PHP is compiled using --with-t1lib[=DIR].
SEE ALSO imagepsloadfont(3).
PHP Documentation Group IMAGEPSFREEFONT(3)
Hi,
I need to know what is the right way of handling out of memory conditions. If a program is not able to dynamically allocate memory (new fails), is it right to wait for some amount of time (say 5 sec) and then try again to allocate memory? Or should we kill the process and again restart it?... (1 Reply)
Hey Linux experts,
I am very new to Linux and PHP. I am trying to install php-5.3.2 on Linux(Centos), but I am getting an error as given below:
cc1: out of memory allocating 2036 bytes after a total of 63528960 bytes
make: *** Error 1
What is exactly meant by this error?Can someone guide... (5 Replies)
Any clues on how to get rid of this PHP error?
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /website/www/includes/functions_manpages.php on line 58
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71... (4 Replies)
While running script I am getting an error like
Few lines in data are not being processed.
After googling it I came to know that adding such line would give some memory to it
ini_set("memory_limit","64M");
my input file size is 1 GB.
Is that memory limit is based on RAM we have on... (1 Reply)