title: Compilation of large class hierarchy consumes lots of memory after adding boost::serialization
body: <p>We needed serialization of quite large C++ class hierarchy with lots of inheritance, contraction, shared pointers, etc. I decided to use <code>boost::serialization</code> library.</p>
  
  <p>My problem is that while compilation of this library on VS 2008 <code>cl</code> takes over 1 GB of RAM memory. I suppose this is caused by template-based serialization in Boost. This causes many problems with building whole project on weaker PCs. What's interesting, compilation time is not so much longer:</p>
  
  <pre><code>no serialization: 15:38 [mm:ss]
  serialization:    17:06 [mm:ss]
  </code></pre>
  
  <p>My question is: is it possible to cut the memory usage? Maybe with longer compilation time?</p>
  
  <h3>Edit</h3>
  
  <p>This increase of used memory happens in several files during compilation of C++/CLI project which <em>actually uses</em> serialization from the library above. Without serialization <code>cl.exe</code> has peak memory on the largest file about 150 MB, usually not more than 80. Increase of memory use is about 4 to 8 times on several files.</p>