Mercurial > hg > graal-jvmci-8
comparison src/share/vm/memory/genMarkSweep.cpp @ 4911:d903bf750e9f
7129514: time warp warnings after 7117303
Summary: Replace calls to os::javaTimeMillis() that are used to update the milliseconds since the last GC to an equivalent that uses a monotonically non-decreasing time source.
Reviewed-by: ysr, jmasa
author | johnc |
---|---|
date | Wed, 18 Jan 2012 09:50:16 -0800 |
parents | aa3d708d67c4 |
children | 9d679effd28c |
comparison
equal
deleted
inserted
replaced
4910:caa4652b4414 | 4911:d903bf750e9f |
---|---|
174 // input to soft ref clearing policy at the next gc. | 174 // input to soft ref clearing policy at the next gc. |
175 Universe::update_heap_info_at_gc(); | 175 Universe::update_heap_info_at_gc(); |
176 | 176 |
177 // Update time of last gc for all generations we collected | 177 // Update time of last gc for all generations we collected |
178 // (which curently is all the generations in the heap). | 178 // (which curently is all the generations in the heap). |
179 gch->update_time_of_last_gc(os::javaTimeMillis()); | 179 // We need to use a monotonically non-deccreasing time in ms |
180 // or we will see time-warp warnings and os::javaTimeMillis() | |
181 // does not guarantee monotonicity. | |
182 jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; | |
183 gch->update_time_of_last_gc(now); | |
180 } | 184 } |
181 | 185 |
182 void GenMarkSweep::allocate_stacks() { | 186 void GenMarkSweep::allocate_stacks() { |
183 GenCollectedHeap* gch = GenCollectedHeap::heap(); | 187 GenCollectedHeap* gch = GenCollectedHeap::heap(); |
184 // Scratch request on behalf of oldest generation; will do no | 188 // Scratch request on behalf of oldest generation; will do no |