Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 671955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:25:50+00:00 2026-05-14T00:25:50+00:00

I have been using a SAX parser for a while now to get data

  • 0

I have been using a SAX parser for a while now to get data from various XML, but today i’m banging my head on a new problem with a hudge XML (compared to the previous ones . here around 12k lines) with a lot of repetitive items in it. Most of the time, the items are part of a block :

  <content>

  <item lbl="blabla">
    <item lbl="blabla"/>
    <item lbl="blabla"/>
  </item>

  <item lbl="blabla">
    <item lbl="blabla"/>
    <item lbl="blabla"/>
    <item lbl="blabla"/>
    <item lbl="blabla"/>
    <item lbl="blabla"/>
    <item lbl="blabla"/>
  </item>
</content>

The blabla part is of course changing…But, I would like to keep the structure of items (they are titles and subtitles). And for that, I append each blabla with a starting and ending tag <itemx>blabla</itemx>, where x is the position in the tree of items (1, 2, 3 or 4).
The slightly problematic part is that with that, I’m creating thousands of useless objects and the garbage collector doesn’t have time to clean after the parser, and the inevitable OutOfMemory comes in my face…
I have no idea of how to deal with it; The best technique would be if I could take the whole content of <content></content>, but i’m not sure that this is possible with a SAX parser.

Any help is welcome and any solution deeply thanked…

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:25:50+00:00Added an answer on May 14, 2026 at 12:25 am

    For the most part, you can’t “create objects fast enough that the GC can’t keep up.” In fact, when a GC needs to happen, your entire app is suspended until it completes, so you just can’t get ahead of it.

    The only exception to this are Bitmaps, which are handled a little specially — they count against the Java heap, even though their allocations don’t happen on it. This is fine, except a Bitmap’s memory doesn’t get freed until its finalizer runs, and finalizers do run separately from the garbage collected and do not block an app. So creating a bunch of bitmaps and simply letting go of them (without calling the method to explicitly release the Bitmap’s memory) can indeed cause an out of memory exception.

    But if you aren’t allocating (and letting go of) Bitmap objects, you have some other problem, probably just… not having enough memory for all of your allocations. You can use the hat tool (and to a lesser extent the simple Java heap information in DDMS) to see what you have allocated that is using so much space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 386k
  • Answers 386k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It would be wise to have a field in the… May 14, 2026 at 11:51 pm
  • Editorial Team
    Editorial Team added an answer I think your attempt differs from the code that you… May 14, 2026 at 11:51 pm
  • Editorial Team
    Editorial Team added an answer There are no technical limitations on how long a method… May 14, 2026 at 11:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.