equal
deleted
inserted
replaced
29 #include "utilities/macros.hpp" |
29 #include "utilities/macros.hpp" |
30 #include "memory/allocation.hpp" |
30 #include "memory/allocation.hpp" |
31 |
31 |
32 #define OSCONTAINER_ERROR (-2) |
32 #define OSCONTAINER_ERROR (-2) |
33 |
33 |
|
34 // 20ms timeout between re-reads of memory limit and _active_processor_count. |
|
35 #define OSCONTAINER_CACHE_TIMEOUT (NANOSECS_PER_SEC/50) |
|
36 |
34 class OSContainer: AllStatic { |
37 class OSContainer: AllStatic { |
35 |
38 |
36 private: |
39 private: |
37 static bool _is_initialized; |
40 static bool _is_initialized; |
38 static bool _is_containerized; |
41 static bool _is_containerized; |
|
42 static int _active_processor_count; |
|
43 |
39 static jlong read_memory_limit_in_bytes(); |
44 static jlong read_memory_limit_in_bytes(); |
40 |
45 |
41 public: |
46 public: |
42 static void init(); |
47 static void init(); |
43 static inline bool is_containerized(); |
48 static inline bool is_containerized(); |