Flush Cache from Within Hotspot

Sam Thomas samuel_thomas at brown.edu
Wed Feb 17 21:55:18 UTC 2021


Hello all,

I am working on a project that explores different architecture 
simulations using JDK14, and I am trying to flush the cache from the 
source code. We are working with an aarch64 target and I have tried the 
following to no avail:

1. Use the clflush C++ built-in instruction (this is an x86 instruction)

2. Dynamically allocate a large (2 MB) block of memory, and assign 
random numbers to the array (Hotspot assertions do not allow for dynamic 
memory allocation)

3. Allocate a large (2 MB) block of memory on the stack, and assign 
random numbers to the array (this properly compiles, but the stack 
overflows and a segmentation fault is raised)

Has anyone done projects like this in the past, or is there a standard 
for how to perform such a procedure? Thank you for your help!

Best,
Sam




More information about the hotspot-gc-dev mailing list