title: Implement object-caching in classic ASP memory-leaking
body: <p>I have tried to implement different caching-implementations in a classic ASP site in order to offload the database during heavy traffic.</p>
  
  <p>My approach was this:</p>
  
  <p><i>Create a global HashTable object in global.asa where I later on store jscript-objects within</i></p>
  
  <pre><code>&lt;object id="SIZE_LIST" progid="System.Collections.HashTable" runat="Server" scope="Application"&gt;&lt;/object&gt;
  </code></pre>
  
  <p>This gives me a global HashTable-object that I at certain time-intervals replace the content of the HashTable. The size will only vary slightly, but I however do .Remove() and .Add() all objects, each time.</p>
  
  <p>This works very well, besides from the fact that after a certain time, the memoryallocation of the app gets to high, giving irrational behaviour of the sessions. It will "forget" sessions, but not invoke OnSessionStart() in global.asa. Therefor, leaving visitors with an empty Session-collection.</p>
  
  <p>Can I somehow improve the memory-reallocation-process? Is there any better approach for object-caching? </p>
  
  <p>I have tried using plain textfiles with json-serialized data, but the deserialization of that is to much overhead. I thought about binary-serialization, but I'm not sure if it's even possible in classic ASP. </p>