ProgressNS / sidekick-feedback

This repository is for feedback regarding NativeScript Sidekick. Use the issues system here to submit feature requests or vote for existing ones.
45 stars 9 forks source link

High CPU usage on startup, device commands stuck in loop #268

Closed pauldbentley closed 6 years ago

pauldbentley commented 6 years ago

Please, provide the details below:

Did you verify whether this issue has already been reported here?

Yes

Tell us about the problem

High CPU usage on startup. I have enabled debug in the config as suggested by other posts and can see that the log is being filled up with the following commands over and over which look to be stuck in a loop:

[18-09-26 10:51:00.409] (Info) ab.childProcessCommunication.shell.cliStdout - Options for ios-device-discovery { platform: undefined, shouldReturnImmediateResult: true, emulator: false } spawn: C:\Android\android-sdk\platform-tools\adb "devices"

[18-09-26 10:51:00.440] (Info) ab.childProcessCommunication.shell.cliStdout - spawn: C:\Android\android-sdk\platform-tools\adb "devices"

[18-09-26 10:51:00.473] (Info) ab.childProcessCommunication.shell.cliStdout - spawn: C:\Android\android-sdk\tools\bin\avdmanager.bat "list" "avds"

This is my first time trying NativeScript so I may have missed something, there is a lot to learn.

Which platform(s) does the issue occur on?

Windows 10

Provide the following version numbers that the issue occurs with:

How to obtain this information is explained in the Gather information about your development environment section.

Tell us how to recreate the issue in as much detail as possible

  1. Start the application
  2. The CPU runs high and the log file grows

Does this issue happen every time?

Yes

Send the client logs

https://gist.github.com/pauldbentley/0a8e2305c14fb63a938716930e7295be

How to obtain the Sidekick logs is explained in the Access the NativeScript Sidekick logs section. To share them with us, you can create a gist with the app logs and send the produced link.

tsvetie commented 6 years ago

Hello @pauldbentley, You should enable debug tracing in the CLI config only for a session that aims to gather a lot of logs in order to debug a problem. You should not keep this setting as the amount of logs produced with this setting will cause Sidekick UI to hang.

Now, regarding the repetitive commands that you see - these are expected as we are checking for new devices. Could you explain in a bit more detail what the original problem was that led you to search for solutions and try to debug the problem?

pauldbentley commented 6 years ago

Ah yes I think I've created my own issue turning the debug tracing on. I think that is the CPU issue, ignore that then.

My original issue was the cloud build for android, I created a sample project and ran the cloud build but it gets stuck on "Upload step started." which never seems to complete. Which is where I found the debug tracing.

How long should the cloud build take?

tsvetie commented 6 years ago

The speed of a cloud build depends on many factors, but taking into account that you have not built this project before (the first build is always slower), I guess it should not take more than 5 minutes. However, you should be getting continuous feedback about the build progress in the Output module. The upload step speed is influenced by both the size of the project and your connection speed.

We have had a similar issue that we could not resolve - #203. The suggestions in that thread did not resolve the problem, but they are a good first step to gather information about the case:

  1. Send me the log files that Sidekick creates: a. Open the log files folder (Help menu -> Show Logs) b. Close Sidekick c. Navigate to %appdata%.nativescript-cli d. Delete the .cloud-git folder e. Delete all log files f. Start Sidekick and run the Cloud build. Once you reach the "Upload step started" step, wait a while and if the build does not continue, quit Sidekick and send me the newly created log files.
  2. Check that you have a .gitignore file in the root of your app and that you have the following in it:
    
    # NativeScript files
    platforms/**/*
    node_modules/**/*
    typings/**/*

NativeScript cloud files

.cloud/*/

3. Execute the following command and send me the file that it creates after it finishes:

tns cloud build ios --emulator --accountId 1 --log trace > log.txt 2>1

pauldbentley commented 6 years ago

Hi,

I've installed Android studio so I can build locally and that works fine.

I do still have the issue that when I open SideKick, and just let it sit there and not do anything, my CPU runs at 33% and the CPU fans runs really hard. It seems to be the "System" process or the "Antimalware service executable".

As soon as I close SideKick the CPU goes down to 1%.

tsvetie commented 6 years ago

Hi @pauldbentley,

Yes, you are correct - this is indeed the case on my side as well. And you were correct in your initial assumption - this is related to the fact that we check for new devices frequently. That is why the result you see is expected.