I am programming in PHP and I have an include file that I have to, well, include, as part of my script. The include file is 400 MB, and it contains an array of objects which are nothing more than configuration settings for a larger project. Here is an example of the contents:
$obj = new obj();
$obj->name = "myname";
....
$objs[$obj->name] = $obj->name;
{repeat}
....
return $objs;
This process repeats itself 40,000 times and ultimately is 650,000 lines long (the file is generated dynamically of course.)
If I am simply trying to load a file that is 400MB, why then would memory usage increase to 6GB? Even if the file is loaded into memory, wouldn't only take up 400 MB of RAM?