title: Out of Memory error/crash after using scroll throughout a tableView of custom rows containing views in titanium appcelerator for android
body: <p>I am using titanium appcelerator for android to write my app.</p>
  
  <p>On my main screen i have a tableView, full of listings that are rows, that paginates 15 at a time. So once u scroll down to 15th row another 15 rows will be added to the table. A screen usually shows 3 to 10 of the rows at a time depending on screen height (samsung mini vs nexus 7)</p>
  
  <p>Each row contains a view which contains several child Views and imageViews. This cause very slow performance when scrolling up and down the list. To solve this i turned the parent view which is added to the row into an image, which increased performance massively when scrolling.</p>
  
  <p>Here is a general snippet</p>
  
  <pre class="lang-js prettyprint-override"><code>    //Turn the entire view "post_view" into an image. post_view consists of many child views    
      var blob = post_view.toImage(null, true);
  
      //Create the Image view of entire post_view, the parent of all child views
      var tempImage = Ti.UI.createImageView({
      height : 'auto',
      width : 'auto',
      top : 0,
      zindex : 3,
      image : blob
      });         
  
  
      /* adding the ImageView created from the parent view which all child ies have      been added to*/
     row.add(tempImage);
  
      /*This is the array of rows to be added to the tableView */
      tabData[i] = row;
  
  
      ........
  
      tableView.appendRow(tabData);
  </code></pre>
  
  <p>However, especially on larger screens when u scroll the app crashes, which using DDMS shows as OutOfMemory error. Which unfortunately i cant post the specific error right now because i dont have access to a larger device now. Also the memory error does also occur when i dont use the method of changing the entire view to an image, but gives less detail on the errors themselves in DDMS.</p>
  
  <p>So im not sure if its related to the toImage method, or im not freeing memory properly in javascript, or if its a titanium or java issue or what.</p>
  
  <p>Anyone any ideas. This has been a problem im trying to fix for a few weeks. I wish i had the specific java errors on hand. But they mostly refer to OutOfMemory</p>