We're Hiring!

bfmatlab - bfGetReader fails for large files

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

bfmatlab - bfGetReader fails for large files

Postby akatsov » Tue Aug 12, 2014 9:49 pm

Hello

I'm trying out bfmatlab but cannot initialize a reader for large image files (100+GB).

Specifically, Matlab hangs or throws a java heap exception when I call bfGetReader. The problem happens at line 89: r.setId(id);

Is there an alternative way to initialize a reader? Can bfmatlab handle large files, and if so what's the right way to read them?

Thanks,

Alex
akatsov
 
Posts: 6
Joined: Mon Aug 11, 2014 10:55 pm

Re: bfmatlab - bfGetReader fails for large files

Postby sbesson » Wed Aug 13, 2014 5:16 am

Hi Alex,

in general, bfmatlab should be able to cope with large image files without throwing Java heap exceptions.
Some information is necessary for us to help you with your issue:
- which version of Bio-Formats are you using?
Code: Select all
>> char(loci.formats.FormatTools.VERSION)

- which file format are you opening?
- how much Java memory is there available on MATLAB?
Code: Select all
java.lang.Runtime.getRuntime().maxMemory/(1024*1024)


Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: bfmatlab - bfGetReader fails for large files

Postby akatsov » Wed Aug 13, 2014 4:00 pm

Hi Sebastien
Thanks for the quick reply. Here's more info:
1. ver: 5.0.3
2. file format: PCORAW. No problem reading files up to 50 GB, but problems with bigger files.
3. 500 MB java heap. Does initialization require space only for metadata, or more?
Thanks,
Alex
akatsov
 
Posts: 6
Joined: Mon Aug 11, 2014 10:55 pm

Re: bfmatlab - bfGetReader fails for large files

Postby sbesson » Wed Aug 13, 2014 4:18 pm

Hi Alex,

for very large files (~100GB), could you try increase your heap size to a larger value e.g. 1024MB and see if this fixes the error?

Best
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: bfmatlab - bfGetReader fails for large files

Postby akatsov » Fri Aug 15, 2014 6:39 pm

Yes -- that fixed it. Thank you. Is there any other method to read large files that's less memory intensive?

Thanks again,

Alex
akatsov
 
Posts: 6
Joined: Mon Aug 11, 2014 10:55 pm

Re: bfmatlab - bfGetReader fails for large files

Postby sbesson » Mon Aug 18, 2014 7:28 pm

Hi Alex,

no, to be able to read files with Bio-Formats, initializing the reader with `setId()` is mandatory. For many formats, including TIFF for instance, the memory requirements are expected to scale linearly with the size of the file so upping the JVM heap size to ~1G is expected for files of this order of magnitude.

Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: Google [Bot] and 1 guest