<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Levente,<br>
<br>
<div class="moz-cite-prefix">Am 19.03.2013 07:26, schrieb Levente
Uzonyi:<br>
</div>
<blockquote
cite="mid:alpine.DEB.2.00.1303190715150.24294@login01.caesar.elte.hu"
type="cite">
<blockquote type="cite">
<br>
I read the whole file into a String and before I sprinkled the
method with debugging aids it looked like:
<br>
</blockquote>
<br>
That's pretty likely the cause of the problem, your image is
probably running out of memory. You can't use more than 512 MB on
windows.
<br>
<br>
</blockquote>
<blockquote
cite="mid:alpine.DEB.2.00.1303190715150.24294@login01.caesar.elte.hu"
type="cite">You should rewrite your code to read the file line by
line (it should be a lot faster this way). E.g.:
<br>
</blockquote>
<br>
I thought of this too but assumed it to be slower as I have to go to
the OS more often. Will check and report.<br>
<br>
I wasn't aware of the hard 512M limit on Win. The normal case would
be 1000 files of 160k each. Each file represents the production test
of one amplifier and in this special case I tested one Amp a
thousand times. <br>
<br>
<br>
<blockquote
cite="mid:alpine.DEB.2.00.1303190715150.24294@login01.caesar.elte.hu"
type="cite"><br>
FileStream readOnlyFileNamed: 'yourBigFile.csv' do: [ :file |
<br>
[ file atEnd ] whileFalse: [
<br>
| line |
<br>
line := file nextLine.
<br>
"process the line" ] ].
<br>
<br>
If your file only contains ASCII characters, then you can optimize
it even further by using StandardFileStream instead of FileStream,
which will save you the time spent with encoding the characters.
<br>
<br>
</blockquote>
<br>
Thanks for the tip.<br>
<br>
Cheers<br>
<br>
Herbert<br>
<br>
<blockquote
cite="mid:alpine.DEB.2.00.1303190715150.24294@login01.caesar.elte.hu"
type="cite">
<br>
Levente
<br>
<br>
<blockquote type="cite">
<br>
initFrom: aString
<br>
"read the protocol file via feeding its lines into a state
machine each performed method returns the state for the next
line"
<br>
|status|
<br>
status := #initialHeaders:.
<br>
aString linesDo: [:line|
<br>
status := self perform: status with: line].
<br>
<br>
Latest Cog VM, image updated to 12333.
<br>
<br>
Cheers,
<br>
<br>
Herbert
<br>
<br>
<br>
<br>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>