title: Memory Issues When DOM Parsing A Large XML File on Android Devices
body: <p>I have an Android application that parses an XML file for users and displays results in a much more mobile friendly format. The app works great for most users, but some users have lots and lots of data and the app crashes on them because it runs out of memory.</p>
  
  <p>Is there any way I have a DOM style XML parser quit parsing data after a certain amount of parsing? I only need the first 30 or so elements so it would make the application much more efficient.</p>
  
  <p>I'd like to use a SAX or pull parser instead, but the XML I'm parsing is <strong>not valid</strong> and I have no control over it. Unless anyone has some good SAX solutions that let me parse messy, invalid XML, I think DOM is the only way to go.</p>
  
  <p>Thanks for reading!</p>