Closed
Bug 54659
Opened 25 years ago
Closed 23 years ago
Running out of file descriptors on large runs of transformiix
Categories
(Core :: XSLT, enhancement, P5)
Core
XSLT
Tracking
()
VERIFIED
FIXED
Future
People
(Reporter: anthony, Assigned: keith)
References
()
Details
Attachments
(4 files)
|
5.76 KB,
text/plain
|
Details | |
|
137 bytes,
text/xml
|
Details | |
|
283 bytes,
text/xml
|
Details | |
|
528 bytes,
patch
|
sicking
:
review+
peterv
:
superreview+
blizzard
:
approval+
|
Details | Diff | Splinter Review |
I have been experiencing some problems load testing transformiix. I have
modified transformiix.cpp to run several thousand times by placing most
of the code for this in a for loop. I then have a small xml test file (test.xml)
which includes a stylesheet test.xsl to generate some output - the details
of the stylesheet's operation aren't relevant. If I run the normal transformiix
from the command line, using:
transfrmx -i test.xml
Things behave as one would expect (excutes once, & generates the correct
output). If I use my modified version, the output is fine for values of n (in
the for loop) to 1020. Above 1020 XMLParser complains that it cannot open a
stream. I suspect that this is due to transformiix reaching it's maximum number
of file descriptors (those allowed per process). This was confirmed when I added
2 delete statements at the bottom of the loop (line 147/148 of the file
transformiix.cpp attached below) and re-compiled/re-ran the code - all
iterations (even up to 10000) completed successfully. Currently ifstream objects
(and ofstream objects) are created and never deleted - thus causing the system
to run out of file descriptors (as well as go short on memory). (That is the
case in main/transformiix.cpp).
There may be other areas where ifstream/ofstream objects are not deallocated
that also need fixing.
The situation can be re-created by running my version of transformiix.cpp
supplying just test.xml to transformiix (since test.xml calls xsl:include to
include test.xsl), first with lines 147 and 148 commented out - so ifstream
and ofstream objects are not deleted as is the case in the distributed
version of transformiix.cpp, and then with the lines uncommented. You
should find that with the lines commented out, things go wrong on the
1021st iteration (when we run out of file descriptors), and if the lines
are included things run to completion (I tested with 10000 iterations). The
value of n is currently set to 1024 to make it easier to see the problem.
Hope that helps. (Files will be attached below).
| Reporter | ||
Comment 1•25 years ago
|
||
| Reporter | ||
Comment 2•25 years ago
|
||
| Reporter | ||
Comment 3•25 years ago
|
||
| Reporter | ||
Comment 4•25 years ago
|
||
That's all the files.
Best wishes,
Anthony
Comment 5•25 years ago
|
||
The opened files should be closed, but as transformiix isn't created to do
massive repeated transformation (a task really only good for profiling), I
rate this as coding style.
Keith, if you feel like it, cleaning up transformiix.cpp to do
1) startup info
2) init streams and data structure
3) process
4) cleanup (and closing files ;-))
would be nice.
But anyway, don't delete streams, close 'm. If we talk about style, then ....
Anthony, please attach patches instead of complete files. And reuse testcases
we all allready have, instead of attaching new ones, which are probably in no
way needed to reproduce that behaviour.
It took me more time to find out what you changed than to evaluate those
changes.
Axel
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Future
| Reporter | ||
Comment 6•25 years ago
|
||
Thanks, sorry for making life more difficult. I'm new to submitting bugs here
and will remember to re use the test cases and supply patches rather than
complete code in the future.
Anthony
| Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Updated•24 years ago
|
Priority: P3 → P5
Axel, is this fixed now?
Comment 10•23 years ago
|
||
If I'd only knew if the ifstream destructor closes.
We might wallpaper this in txStandaloneProcessor::parsePath.
Comment 11•23 years ago
|
||
fix for standalone only, not part of build. r=?
Comment on attachment 103975 [details] [diff] [review]
close() in txStandaloneProcessor::parsePath
r=sicking
Attachment #103975 -
Flags: review+
Comment 13•23 years ago
|
||
Comment on attachment 103975 [details] [diff] [review]
close() in txStandaloneProcessor::parsePath
sr=peterv, but wouldn't it be better to move the close up to just after
xmlParser.parse(...)?
Attachment #103975 -
Flags: superreview+
Comment 14•23 years ago
|
||
Comment on attachment 103975 [details] [diff] [review]
close() in txStandaloneProcessor::parsePath
a=blizzard on behalf of drivers for 1.2final
Attachment #103975 -
Flags: approval+
Updated•23 years ago
|
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 15•23 years ago
|
||
checked in.
You need to log in
before you can comment on or make changes to this bug.
Description
•