<div dir="ltr"><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Hi,</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">We’ve stumbled upon memory
problems when using huge raster levels.</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">For instance for a
common TMS/WMS server on the full level you will have something like:</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Raster Size: 268435456x268435456
</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Block Size: 256x256</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">With SUBBLOCK_SIZE 64 this
results in:</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">nSubBlocksPerRow = </span><span style="font-family:"Calibri","sans-serif";font-size:11pt">268435456 / 256 / 64 = 16384</span><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"></span></font></p>
<font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">nSubBlocksPerColumn = </span><span style="font-family:"Calibri","sans-serif";font-size:11pt">268435456 / 256 / 64 = 16384</span><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"></span></font></p>
<font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"><span> </span></font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">for each band papoBlocks will
therefore have the size:</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">sizeof(void*) *
nSubBlocksPerRow * nSubBlocksPerColumn </span><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">=> 2GB (64bit) and 1GB (32bit)</span></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">On 32bit system you
will have out of memory exception with just one RGB raster and on 64bit you
will of course also get problems very fast.</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">One solution would be
to increase SUBBLOCK_SIZE:</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">#define SUBBLOCK_SIZE 256</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">#define TO_SUBBLOCK(x) ((x)
>> 8)</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">#define WITHIN_SUBBLOCK(x)
((x) & 0xff)</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">This will result in
128MB (64bit) for the size of </span><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">papoBlocks instead of 2GB.</span><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"></span></font></p>
<font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><font color="#000000"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">Perhaps an even better
solution would be to make </span><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt">SUBBLOCK_SIZE not a constant but instead dependent on nBlocksPerRow. </span></font></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">For instance:</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">toSubBlockShift = log2(nBlocksPerRow)/2;</font></span></p>
<font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">subBlockSize = <span> </span>1 << toSubBlockShift;</font></span></p>
<font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">withinSubBlockMask = subBlockSize-1;</font></span></p>
<font color="#000000" face="Times New Roman" size="3">

</font><div class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></div><div class="MsoNormal" style="margin:0cm 0cm 0pt">
<span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">For the above example this would result in subBlockSize=1024 and just 8MB (64bit) for papoBlocks.</font></span></div>
<div class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"></font></span> </div><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">This will handle even
bigger rasters better and scale better for smaller.</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Hopefully the performance
impact for not having simple defines will not be noticeable, but I don’t think
so.</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000"> </font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Kind regards,</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font><p class="MsoNormal" style="margin:0cm 0cm 0pt"><span lang="EN-US" style="font-family:"Calibri","sans-serif";font-size:11pt"><font color="#000000">Dennis</font></span></p><font color="#000000" face="Times New Roman" size="3">

</font></div>