profesorfalken / jProcesses

Get crossplatform processes details with Java
Apache License 2.0
63 stars 26 forks source link

getProcessList empty on Windows 8.1 #19

Open ettoreleandrotognoli opened 7 years ago

ettoreleandrotognoli commented 7 years ago

I'm trying to use JProcess.getProcessList() in a Windows 8.1 but the result is empty.

profesorfalken commented 7 years ago

Hi, are you getting any error? Are you using maven? or you have simply downloaded the JAR?

ettoreleandrotognoli commented 7 years ago

Hi! No, I'm not getting any error, just the result list is empty. Yes I install with maven and gradle.

jflefebvre06 commented 5 years ago

Randomly I get the same proplem on Windows 7, JProcess.getProcessList() return only one idle process

jflefebvre06 commented 5 years ago

A very simple test to reproduce. After 30 calls JProcesses.get().fastMode(true).listProcesses() returns only one process.

    public static void main(final String[] args) throws InterruptedException {

        final StopWatch stopWatch = StopWatch.createStarted();

        int nb = 0;
        while (true) {

            nb++;

            final List<ProcessInfo> allProcess = JProcesses.get().fastMode(true).listProcesses();

            if (allProcess.size() <= 10) {

                System.out.println("After " + nb + " calls");

                allProcess.forEach(p -> {
                    System.out.println("- " + p);
                });

                break;

            } else {
                TimeUnit.MILLISECONDS.sleep(300);
            }

        }

        System.out.println(stopWatch.getTime(TimeUnit.SECONDS) + " seconds");
    }

Console:

After 30 calls
- PID:0 CPU:null    MEM:24  PRIORITY:0  CMD:
96 seconds

p.getName() return System Idle Process

If I launch again, return empty list:

After 1 calls
1 seconds
Artem-Kuz commented 3 years ago

Hi, I am facing the same issue as well on Windows 10, Are there some plans to fix this?