title: Mixed Write for GSON
body: <p>I am using GSON object model access to construct JSON to be used as body of my POST webservice calls in Jmeter.</p>
  
  <p>Now I frequently encounter : GCC Out of memory exception with the error pointing to the code section=> gson.toJson(objectToSerialize).
  From the past posts, it was suggested to use gson serialization with the streaming access model.</p>
  
  <p>My current code does this: Create an object of an class by populating its variables and passes this class on to the GSON serializer, gets back the constructed JSON in form of string and I use them.</p>
  
  <p>Could the experts suggest, is there a way that I could integrate streaming access model into my code without having to do much of a rework. Would this be memory efficient?
  PS: I took a look into Mixed writes example specified in this link but unable to get around how to construct a JSON by passing one object of the class as we do in the object model:
  <a href="https://sites.google.com/site/gson/streaming" rel="nofollow">https://sites.google.com/site/gson/streaming</a></p>
  
  <p>Thank you!</p>