Crash when reading 1000 image files from fibers

Alan Bateman Alan.Bateman at oracle.com
Sun Sep 1 08:03:43 UTC 2019


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). 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