This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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!