Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding PipedOutputStream and Garbage Collector  RSS feed

 
Rohit Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a huge xml file, from which i read element and write to files. (in read and write two paraller threads.)

I am writing data to PipedOutputStream in read thread and then read from PipedOutputStream in write thread and write it to file.

There are around 10 laks complex elements and after writing around 5 laks elements it stops at a particular point every time for long time and then procedes slowly to the end.

What would be the reason? Is it garbage collecting at that point?
How should i improve it?

Thanks in advance...
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a start you can enable -XX:+PrintGCDetails and -verbose:gc option to find out if gc is happening at that time.
This articlegives some more insight into java GC and this one lists all the options related to GC.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!