<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi, <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"><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>
You should rewrite your code to read the file line by line (it
should be a lot faster this way). E.g.:
<br>
<br>
FileStream readOnlyFileNamed: 'yourBigFile.csv' do: [ :file |
<br>
[ file atEnd ] whileFalse: [
<br>
| line |
<br>
line := file nextLine.
<br>
"process the line" ] ].
<br>
<br>
</blockquote>
biggest gain is the reduction from 470 MB of peak memory to 352 MB.
Time went down from 2:40 to 2:15 it seems most of the time is spent
in initializing the objects. Changing more ivars to symbols brought
the time back up to 2:25 but memory down to 227 MB. Never thought
of symbols as memory savers before :-)<br>
<br>
Thanks for the tip, <br>
<br>
Herbert<br>
<blockquote
cite="mid:alpine.DEB.2.00.1303190715150.24294@login01.caesar.elte.hu"
type="cite">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>
<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>