Re: [rvm-research] Data collection got destroyed before shutdown hooks finish

Erik Brangs <[email protected]> Sat, 30 Mar 2019 10:05:24 +0100
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
Hi,

On 28.03.19 09:19, Kenan Liu wrote:
> I asked the similar question before. Our problem was populate all data we collected in the end of VM execution so that we can make sure those I/O operations would not affect the Jikesrvm behaviours.
>
> At that time Erik Brangs suggested to use shutdown hooks to print out the data. It worked (thanks!) until we increased the size of data to more than 20 thousand entries in an arraylist.
>
> Right now we got around 50 thousand entries of arraylist and write it to a file using shutdown hook, but I always get an NullPointerError for the arraylist I created after around 15 thousand entries got printed.
>
> I learned shutdown hooks would only be stopped in some certain cases via signal like /user requesting a termination (Ctrl+C), a SIGTERM being issued by O/S (normal kill command, without -9), or when the operating system is shutting down/ I don't think it belongs to any one of these cases.
>
> If there is any place in JikesRVM would send terminate signal if the shutdown procedure exceeds certain time limit? Or if there is a forced GC cycles (or something similar) during VM shutdown time?
>
> I have no clue why it would happen. It would be nice If there is a way to trace the object gets destroyed.

If you're using normal Java-level objects (as opposed to unboxed types), the object should not get collected while it's alive. You can check if any GCs happen by using the -verbose:gc command line argument.

Another possibility is that it's not really a NullPointerException but an invalid memory access. Jikes RVM converts all segmentation faults to NullPointerExceptions.

There are also some opt compiler bugs that manifest as NullPointerExceptions.

It's hard to say anything more concrete without seeing the code.


Kind regards,

Erik Brangs