I wrote a PHP script that index the contents of my site and stores it in multi-dimensional arrays. Then I export what is in the memory, that array, to a .php file to include and access later.
How can I check the size of the memory or the size of the memory associated with the variable I'm exporting before I save it to a file.
For example, if less than 1gb, export. Else, do nothing and erase what's in memory associated with variable $x.
How could I do this?