<span style="font-family: Arial;">Re Gill, best speak directly to Karl<br><br><div id="htc_header" style="">----- Reply message -----<br>From: &quot;Martin Denham&quot; &lt;mjdenham@gmail.com&gt;<br>To: &quot;J-Sword Developers Mailing List&quot; &lt;jsword-devel@crosswire.org&gt;<br>Subject: [jsword-devel] Memory analysis<br>Date: Sat, May 31, 2014 13:13<br><br></div></span><br><div dir="ltr"><div><b>Tidy up omission</b></div><div>Is it a mistake that</div>  ZVerseBackendState.lastUncompressed<div>is not being cleared in</div><div>  ZVerseBackendState.releaseResources()</div><div>because lastUncompressed can hold a large chunk of memory.</div>
<div><br></div><div><b>Large identical byte[] Allocations</b></div><div>There are 4 identical memory allocations when a passage is decompressed all of byte[expectedSize] but I can&#39;t think how to avoid this or even if it is possible.</div>
<div><br></div><div>Each of the first 3 lines of uncompress() allocate an identically large chunk of memory:</div><div><div>    public ByteArrayOutputStream uncompress(int expectedLength) throws IOException {</div><div>        ByteArrayOutputStream out = new ByteArrayOutputStream(expectedLength);</div>
<div>        InflaterInputStream in = new InflaterInputStream(input, new Inflater(), expectedLength);</div><div>        byte[] buf = new byte[expectedLength];</div></div><div><br></div><div>And a further identical allocation is made in the calling method:</div>
<div><div>            uncompressed = CompressorType.fromString(compressType).getCompressor(data).uncompress(uncompressedSize).toByteArray();</div></div><div><br></div><div><b>Gill Block Type</b></div><div>Possibly an issue for Xiphos.  Can somebody confirm that the following conf setting is incorrect for a commentary because Gill has extremely large memory requirements and does not run on some small mobiles.  Gill has the following in it&#39;s conf:<br>
BlockType=BOOK<br><br>Most other commentaries seem to have:<br>BlockType=CHAPTER</div><div>and I suspect this means JSword attempts to load a whole Bible book of commentary notes in order to return notes for 1 verse, which will have a large memory requirement.</div>
<div><br></div><div>Martin</div><div><br></div><div>Is it just a matter of changing the conf or will the whole module need to be regenerated.</div><div><br></div><div>I can raise it with the Xiphos team if somebody confirms my understanding but I raised this on sword-devel several years ago but that was probably the wrong place.</div>
</div>