I am aware that XDebug’s delta should not be considered accurate. However, when tracing a script using XDebug, I have a few requires that will eat up 2MB of memory.
What is the best way to limit the impacts of require()? Should I split up my files (in logical groups) making them smaller? Would converting to classes help?
Xdebug is accurate when you’re including new files.
However, neither of the two options you say will work. If you split then you get more overhead (there is some overhead per file). If you create classes then that will create overhead. If you don’t have APC installed, then that could be a good idea as at least the memory used by requires/includes will get shared among the different apache processes (in case you’re using Apache). Xdebug will then show only a small increase for each include/require in case APC has already cached the file.
cheers,
Derick