[ome-devel] in-memory reading

Manuel Stritt manuel.stritt at idorsia.com
Mon Sep 25 09:19:13 BST 2017


Hi Roger,

thanks a lot for this detailed analysis, I highly appreciate this!

Regards,
Manuel


On 01/09/17 15:14, Roger Leigh wrote:
>
>> On 01/09/17 10:00, Manuel Stritt wrote:
>>
>>> Dear all,
>>>
>>> I'm trying to use the in-memory reading method as documented here:
>>>
>>> https://docs.openmicroscopy.org/bio-formats/5.6.0/developers
>>> /in-memory.html
>>>
>>>
>>> in combination with a NDPI reader + BufferedImageReader:
>>>
>>
>> Making this into a compilable example, the stack trace is this:
>>
> [...]
>
> Dear Manuel,
>
> I've written another two small examples as modifications to test exactly
> where the failure lies.
>
> testfile replaces the in-memory I/O with regular file I/O.  This works
> correctly, with BufferedImageReader.
>
> testplain retains the in-memory I/O but replaces BufferedImageReader
> with regular openBytes.  This fails:
>
> Reading file into memory from disk...
> 3544235 bytes read.
> size reader: 3968 x4864
> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>         at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
>         at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
>         at loci.common.ByteArrayHandle.setLength(ByteArrayHandle.java:111)
>         at loci.common.ByteArrayHandle.seek(ByteArrayHandle.java:180)
>         at
> loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:174)
>         at
> loci.formats.services.JPEGTurboServiceImpl.getTile(JPEGTurbo
> ServiceImpl.java:303)
>         at
> loci.formats.services.JPEGTurboServiceImpl.getTile(JPEGTurbo
> ServiceImpl.java:235)
>         at loci.formats.in.NDPIReader.openBytes(NDPIReader.java:191)
>         at loci.formats.FormatReader.openBytes(FormatReader.java:886)
>         at testplain.main(testplain.java:43)
>
> It's clear that the NDPI reader is behaving differently with the in
> memory stream vs a regular file stream.
>
> This has been recorded here:
> https://trello.com/c/C4v0GnWv/185-ndpi-in-memory-reading
>
>
> Regards,
> Roger
>
> --
> Dr Roger Leigh -- Open Microscopy Environment
> Wellcome Trust Centre for Gene Regulation and Expression,
> College of Life Sciences, University of Dundee, Dow Street,
> Dundee DD1 5EH Scotland UK   Tel: (01382) 386364
>
> The University of Dundee is a registered Scottish Charity, No: SC015096
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>

-- 

The information of this email and in any file transmitted with it is 
strictly confidential and may be legally privileged.
It is intended solely for the addressee. If you are not the intended 
recipient, any copying, distribution or any other use of this email is 
prohibited and may be unlawful. In such case, you should please notify the 
sender immediately and destroy this email.
The content of this email is not legally binding unless confirmed by letter.
Any views expressed in this message are those of the individual sender, 
except where the message states otherwise and the sender is authorized to 
state them to be the views of the sender's company.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20170925/5870a307/attachment.html>


More information about the ome-devel mailing list