I use Embarcadero Delphi XE5 Enterprise Edition. I have a project group consisting of 17 projects. When I click 'Compile All' after 7th compiled project IDE throw me an exception:
[Fatal Error] Exception of type 'System.OutOfMemoryException' was thrown.
What is a reason of such error and how to handled with it?
The Delphi IDE has several issues managing memory that were never really fixed by Embarcadero, one of the main issue is that the IDE and compiler have huge memory consumption due to caches that are not released between compilation runs.
A workaround that I've applied with success with my codebase is to compile all the projects from the command line with a tool like ANT using the dcc compiler, this will save IDE memory consumption. In the case you need to debug applications then you can compile and build a project at time and restart the IDE every 2/3 compilation.
Another workaround that I've applied successfully in Delphi XE7 to reduce IDE memory consumption was renaming the following IDE files :
This makes the XE7 IDE usable again; just the refactoring feature aren’t available anymore.
If the aforementioned solutions don't work for you you will have to split your project group in single projects and switch between project each time as someone else suggested commenting your question.
The new Delphi 10 Seattle seems to address some of these memory related issues since they claim :
“Under the hood” the IDE’s project, file, and build management handling has gone through a major overhaul and redesign to provide significantly extended available memory, giving developers a more stable, capable, and faster development experience.
But honestly I don't think it is the definitive solution, is just an improvement of the situation. The final solution of this situation is a 64bit IDE that is not a simple thing to implement by them since I think they have to handle a legacy and not very flexible codebase ...
Try the new Delphi 10 and see if the situation improve, if not apply the workaround and wait for a 64bit IDE release.