Crash when reading 1000 image files from fibers
David Holmes
david.holmes at oracle.com
Sun Sep 1 09:58:37 UTC 2019
On 1/09/2019 6:03 pm, Alan Bateman wrote:
> On 01/09/2019 07:50, Cay Horstmann wrote:
>> I just checked out Loom from Github on a Linux machine and changed the
>> example from http://horstmann.com/unblog/2019-07-27/ to use fibers.
>> Good news: The code is much clearer than with completable futures. I
>> schedule 1000 fibers that do this work:
>>
>> public void load(LocalDate date, ImageInfo info) {
>> try {
>> URL url = new URL(info.getUrlForDate(date));
>> var in = url.openStream();
>> info.findImage(new String(in.readAllBytes()));
>> in.close();
>> url = new URL(info.getImagePath());
>> in = url.openStream();
>> info.setImageData(in.readAllBytes());
>> in.close();
>> process(info); // Saves the bytes to a file
>> } catch (Exception ex) {
>> ex.printStackTrace();
>> }
>> }
>>
>> Unfortunately, after about 800 images, the program dies with the
>> message below.
>>
>> Does this look like I am touching anything that's not yet supported?
>> If not, do you really want crash reports sent to
>> http://bugreport.java.com/bugreport/crash.jsp, or is there some other
>> process?
> I don't think bugreport.java.com knows about this project (it doesn't
> know about the other main projects either).
Might be a good idea for all projects with their own repos and builds to
update that message to not direct people to
http://bugreport.java.com/bugreport/crash.jsp. We've had a couple come
through for other projects already.
Cheers,
David
------
So here is best. Is the
> example small enough to send? There are a number of stability issues
> right now, sadly this is normal while we are still in this
> prototyping/exploration phase.
>
> -Alan
>
More information about the loom-dev
mailing list