Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8538537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:08:27+00:00 2026-06-11T11:08:27+00:00

Why java.lang.management isn’t available in android? (At least i know that) I need the

  • 0

Why java.lang.management isn’t available in android? (At least i know that)

I need the use of “getCurrentThreadCpuTime” from “ThreadMXBean” class but I need ManagementFactory in order to retrieve it.

Is there an alternative to that class in android?

I need the cpu time spent by my thread.

Thanks in advance
Leonardo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:08:28+00:00Added an answer on June 11, 2026 at 11:08 am

    Android run on linux, so you can get the thread info from file /proc/$pid/stat.

    You can read and analyse file /proc/$pid/stat to get the info you want.

    public void getTotalMemory() {
    String path = "/proc/$pid/stat";
    String info="";
    try {
        FileReader fr = new FileReader(path);
        BufferedReader localBufferedReader = new BufferedReader(fr, 8192);
        while ((info = localBufferedReader.readLine()) != null) {
            //analyse 
            System.out.println("ThreadInfo:" + info);
        }
        // close...
        } catch (IOException e) {
        }
    }
    

    How to analyse thread status

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that calls getStackTrace() on a java.lang.management.ThreadInfo object, but the StackTraceElement
java.lang.IllegalStateException: Could not execute method of the activity . I am new to Android.
I keep getting 21002 'java.lang.NullPointerException' errors from Apple when I try to test my
import java.lang.ref.SoftReference; import java.util.HashMap; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Message; public class AsyncImageLoader {
I usually use the Hibernate ThreadLocal session management pattern in Java web projects: The
import java.lang.System; public class Splitter{ public static void main(String args[]){ String path_separator = Path
import java.lang.Math; public class NewtonIteration { public static void main(String[] args) { System.out.print(rootNofX(2,9)); }
import java.lang.reflect.Array; public class PrimitiveArrayGeneric { static <T> T[] genericArrayNewInstance(Class<T> componentType) { return (T[])
Exception in thread main java.lang.NullPointerException at Library.loadBooks(Library.java:179) at UseLibrary.main(UseLibrary.java:105) This error makes me crazy!
I am calling java.lang.Runtime.exec(...) but this seems to accept the command lines as an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.