Ionic-app-scripts: Quitting `ionic serve` leaves 3 processes running

Created on 3 Oct 2016  路  10Comments  路  Source: ionic-team/ionic-app-scripts

I noticed that one of the reasons of high CPU and RAM consumption since RC.0 may be because when I quit ionic serve with the q command, one npm process plus two node processes are kept running. Quitting ionic with the escape sequence Ctrl+C instead kills all processes correctly.

This is what I think is happening. I'm using process ids for tracking:

  1. I run ionic serve -d -x -w safari (disables live reload and proxy to isolate perf issues)
  2. ionic (16431) runs npm (16448)
  3. npm (16448) runs node (16449)
  4. node (16449) runs another node (16450)
  5. Quitting ionic leaves process npm (16448) running without a parent, along with children node processes (16449, 16450). In my case that means 640 MB of RAM.
    Imgur
    Imgur
    Imgur
  6. If I run ionic serve again, these 3 hanging processes usually get killed and replaced by new ones. But sometimes one or two of the node processes stay forever until I manually kill them.

My system info:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan => macOS Sierra
Node Version: v4.6.0
Xcode version: Xcode 8.0 Build version 8A218a

Thanks!

bug

Most helpful comment

ps -ef | grep "ionic" should show any processes related to ionic running (I think, anyway) 馃槃

Thanks,
Dan

All 10 comments

On Windows this seems to also sometimes keep the .tmp folder locked and causes a build failure when a subsequent build tries to clean the folder.

This issue has been resolved for awhile in the latest CLI and app-scripts.

Can you install:

npm install -g ionic
npm install @ionic/app-scripts@latest

I'll re-open if we're still having issues with this.

Thanks,
Dan

Thanks Dan, I can confirm that this no longer happens since 0.0.37, plus RAM consumption seems to have decreased by a truck load 馃殮 馃憤

@FdezRomero, w00t! Glad to hear it! BTW, we are up to 0.0.39, may be worth checking out.

Thanks,
Dan

what i can't figure out is how to ps aux the hanging process or whatever that is blocking up the new server from starting. @danbucholtz any idea what command i would have to do to identify a lost ionic process?

ps -ef | grep "ionic" should show any processes related to ionic running (I think, anyway) 馃槃

Thanks,
Dan

that did it! _before_ i was just ps aux | grep ionic and i couldn't see anything. but that worked perfect for finding the ionic process. i kill -9 <pid> and then it stopped the process running on localhost. Thanks so much! obviously i know this isn't the best way to shut down the process, but when they get away from you it seems like it. thank you thank you thank you.

hey guys, this does still happen on Win7

$ ionic info

Your system information:

 ordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4-201701101946
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v6.9.1
Xcode version: Not installed

@ataraxus,

We'll check it out, thanks!

Thanks,
Dan

Going to track this at #438 instead.

Closing this one.

Thanks,
Dan

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loicfavory picture loicfavory  路  4Comments

jgw96 picture jgw96  路  3Comments

itryan picture itryan  路  3Comments

nalkon picture nalkon  路  4Comments

isflo96 picture isflo96  路  3Comments