java_runtime.h 755 B

12345678910111213141516171819202122232425
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_ANDROID_JAVA_RUNTIME_H_
  5. #define BASE_ANDROID_JAVA_RUNTIME_H_
  6. #include "base/android/scoped_java_ref.h"
  7. #include "base/base_export.h"
  8. namespace base {
  9. namespace android {
  10. // Wrapper class for using the java.lang.Runtime object from jni.
  11. class BASE_EXPORT JavaRuntime {
  12. public:
  13. // Fills the total memory used and memory allocated for objects by the java
  14. // heap in the current process. Returns true on success.
  15. static void GetMemoryUsage(long* total_memory, long* free_memory);
  16. };
  17. } // namespace android
  18. } // namespace base
  19. #endif // BASE_ANDROID_JAVA_RUNTIME_H_