title: Lua garbage collection and C userdata
body: <p>In my game engine I expose my Vector and Color objects to Lua, using userdata.</p>
  
  <p>Now, for every even locally created Vector and Color from within Lua scripts, Luas memory usage goes up a bit, it doesn't fall until the garbage collector runs.</p>
  
  <p>The garbage collector causes a small lagspike in my game.</p>
  
  <p>Shouldn't the Vector and Color objects be immediately deleted if they are only used as arguments? For example like: <code>myObject:SetPosition( Vector( 123,456 ) )</code></p>
  
  <p>They aren't right now - the memory usage of Lua rises to 1,5 MB each second, then the lag spike occurs and it goes back to about 50KB.</p>
  
  <ul>
  <li>How can I solve this problem, is it even solvable?</li>
  </ul>