8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "gc_implementation/shared/gcTimer.hpp"
29 #include "gc_implementation/shared/gcTraceTime.hpp"
30 #include "gc_interface/collectedHeap.hpp"
31 #include "gc_interface/collectedHeap.inline.hpp"
32 #include "memory/referencePolicy.hpp"
33 #include "memory/referenceProcessor.hpp"
34 #include "oops/oop.inline.hpp"
35 #include "runtime/java.hpp"
36 #include "runtime/jniHandles.hpp"
37
38 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
39 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL;
40 jlong ReferenceProcessor::_soft_ref_timestamp_clock = 0;
41
42 void referenceProcessor_init() {
43 ReferenceProcessor::init_statics();
44 }
45
46 void ReferenceProcessor::init_statics() {
47 // We need a monotonically non-decreasing time in ms but
48 // os::javaTimeMillis() does not guarantee monotonicity.
49 jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
50
51 // Initialize the soft ref timestamp clock.
52 _soft_ref_timestamp_clock = now;
53 // Also update the soft ref clock in j.l.r.SoftReference
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/javaClasses.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "gc/shared/collectedHeap.hpp"
29 #include "gc/shared/collectedHeap.inline.hpp"
30 #include "gc/shared/gcTimer.hpp"
31 #include "gc/shared/gcTraceTime.hpp"
32 #include "gc/shared/referencePolicy.hpp"
33 #include "gc/shared/referenceProcessor.hpp"
34 #include "oops/oop.inline.hpp"
35 #include "runtime/java.hpp"
36 #include "runtime/jniHandles.hpp"
37
38 ReferencePolicy* ReferenceProcessor::_always_clear_soft_ref_policy = NULL;
39 ReferencePolicy* ReferenceProcessor::_default_soft_ref_policy = NULL;
40 jlong ReferenceProcessor::_soft_ref_timestamp_clock = 0;
41
42 void referenceProcessor_init() {
43 ReferenceProcessor::init_statics();
44 }
45
46 void ReferenceProcessor::init_statics() {
47 // We need a monotonically non-decreasing time in ms but
48 // os::javaTimeMillis() does not guarantee monotonicity.
49 jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
50
51 // Initialize the soft ref timestamp clock.
52 _soft_ref_timestamp_clock = now;
53 // Also update the soft ref clock in j.l.r.SoftReference
|