summaryrefslogtreecommitdiff
path: root/runtime/openjdkjvmti
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/openjdkjvmti')
-rw-r--r--runtime/openjdkjvmti/Android.bp2
-rw-r--r--runtime/openjdkjvmti/OpenjdkJvmTi.cc4
-rw-r--r--runtime/openjdkjvmti/ti_heap.cc (renamed from runtime/openjdkjvmti/heap.cc)8
-rw-r--r--runtime/openjdkjvmti/ti_heap.h (renamed from runtime/openjdkjvmti/heap.h)8
4 files changed, 15 insertions, 7 deletions
diff --git a/runtime/openjdkjvmti/Android.bp b/runtime/openjdkjvmti/Android.bp
index 5095cfd790..b323aef0db 100644
--- a/runtime/openjdkjvmti/Android.bp
+++ b/runtime/openjdkjvmti/Android.bp
@@ -18,10 +18,10 @@ cc_defaults {
defaults: ["art_defaults"],
host_supported: true,
srcs: ["events.cc",
- "heap.cc",
"object_tagging.cc",
"OpenjdkJvmTi.cc",
"ti_class.cc",
+ "ti_heap.cc",
"ti_method.cc",
"ti_stack.cc",
"transform.cc"],
diff --git a/runtime/openjdkjvmti/OpenjdkJvmTi.cc b/runtime/openjdkjvmti/OpenjdkJvmTi.cc
index 50b50d6661..d9031ea652 100644
--- a/runtime/openjdkjvmti/OpenjdkJvmTi.cc
+++ b/runtime/openjdkjvmti/OpenjdkJvmTi.cc
@@ -39,7 +39,6 @@
#include "art_jvmti.h"
#include "base/mutex.h"
#include "events-inl.h"
-#include "heap.h"
#include "jni_env_ext-inl.h"
#include "object_tagging.h"
#include "obj_ptr-inl.h"
@@ -48,6 +47,7 @@
#include "thread_list.h"
#include "thread-inl.h"
#include "ti_class.h"
+#include "ti_heap.h"
#include "ti_method.h"
#include "ti_stack.h"
#include "transform.h"
@@ -346,7 +346,7 @@ class JvmtiFunctions {
}
static jvmtiError ForceGarbageCollection(jvmtiEnv* env) {
- return ERR(NOT_IMPLEMENTED);
+ return HeapUtil::ForceGarbageCollection(env);
}
static jvmtiError IterateOverObjectsReachableFromObject(
diff --git a/runtime/openjdkjvmti/heap.cc b/runtime/openjdkjvmti/ti_heap.cc
index 1799e1957d..6b207430ff 100644
--- a/runtime/openjdkjvmti/heap.cc
+++ b/runtime/openjdkjvmti/ti_heap.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "heap.h"
+#include "ti_heap.h"
#include "art_jvmti.h"
#include "base/macros.h"
@@ -210,4 +210,10 @@ jvmtiError HeapUtil::GetLoadedClasses(jvmtiEnv* env,
return ERR(NONE);
}
+jvmtiError HeapUtil::ForceGarbageCollection(jvmtiEnv* env ATTRIBUTE_UNUSED) {
+ art::Runtime::Current()->GetHeap()->CollectGarbage(false);
+
+ return ERR(NONE);
+}
+
} // namespace openjdkjvmti
diff --git a/runtime/openjdkjvmti/heap.h b/runtime/openjdkjvmti/ti_heap.h
index b6becb97bb..570dd0c6ce 100644
--- a/runtime/openjdkjvmti/heap.h
+++ b/runtime/openjdkjvmti/ti_heap.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_RUNTIME_OPENJDKJVMTI_HEAP_H_
-#define ART_RUNTIME_OPENJDKJVMTI_HEAP_H_
+#ifndef ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_
+#define ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_
#include "jvmti.h"
@@ -36,6 +36,8 @@ class HeapUtil {
const jvmtiHeapCallbacks* callbacks,
const void* user_data);
+ static jvmtiError ForceGarbageCollection(jvmtiEnv* env);
+
ObjectTagTable* GetTags() {
return tags_;
}
@@ -46,4 +48,4 @@ class HeapUtil {
} // namespace openjdkjvmti
-#endif // ART_RUNTIME_OPENJDKJVMTI_HEAP_H_
+#endif // ART_RUNTIME_OPENJDKJVMTI_TI_HEAP_H_