Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes throws java.lang.NumberFormatException #17

Open
ghost opened this issue Aug 17, 2012 · 2 comments
Open

Sometimes throws java.lang.NumberFormatException #17

ghost opened this issue Aug 17, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 17, 2012

Description

JVM works on Ubuntu

Scheduled task inside JVM periodically ask system statistics and catch following exceptions:

  • java.lang.NumberFormatException: null
    at java.lang.Long.parseLong(Unknown Source)
    at java.lang.Long.parseLong(Unknown Source)
    at com.jezhumble.javasysmon.LinuxMonitor.uptimeInSeconds(LinuxMonitor.java:105)
    at com.jezhumble.javasysmon.JavaSysMon.uptimeInSeconds(JavaSysMon.java:156)
  • java.lang.NumberFormatException: null
    at java.lang.Long.parseLong(Unknown Source)
    at java.lang.Long.parseLong(Unknown Source)
    at com.jezhumble.javasysmon.LinuxMonitor.physical(LinuxMonitor.java:66)
    at com.jezhumble.javasysmon.JavaSysMon.physical(JavaSysMon.java:192)

I can't detect some preconditions of specified errors. Time between exceptions aren't fixed.
Files in /proc are exists and contains required values.

Various system info

uname -a
Linux xxxxx-Ubuntu SMP Tue Aug 30 19:33:19 UTC 2011 x86_64 GNU/Linux

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"

cat /proc/meminfo
MemTotal: 1697024 kB
MemFree: 864440 kB
... etc

cat /proc/uptime
80084.28 149307.49

@oldirtybasti
Copy link

I can confirm this bug on Ubuntu. Sometimes

JavaSysMon monitor = new JavaSysMon();
ProcessInfo[] processes = monitor.processTable();

crashes due to a NumberFormatException. The Number that was parsed contains "slee". I think some process might be sleeping?

Would be greate if you could look into that. Great library by the way, I use it every day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@oldirtybasti and others