On Mar 3, 2:41pm, dmitry.samers...@oracle.com (Dmitry Samersoff) wrote: -- Subject: Re: stop using mmap for zip I/O
| Christos, | | JVM install it's own signal handler and use it to numerous tasks, so add | signal handler to zip_util.c is problematic. Yes, I understand; this is why I mentioned that we not change it until the pure java implementation is released. | The simplest way to address the problem is use mlock/munlock to test | page presence before touching it. | | i.e. add code like | | if ((i % 4096) == 0) { | if ( mlock(v+i, 4096) < 0) { | printf("No page. Bail out\n"); | return; | } | } | | to *compute()* in your example below. Yes, that fixes it too, at the cost of more syscalls and complexity... I just mentioned disable mmap, because it is easy and fixes a common problem without any performance penalties. Perhaps the mmap code made sense when it was mapping the whole file, but now mapping just the central directory doesn't. (IMHO :-) christos