{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/7407","repository_url":"https://api.github.com/repos/appium/appium","labels_url":"https://api.github.com/repos/appium/appium/issues/7407/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/7407/comments","events_url":"https://api.github.com/repos/appium/appium/issues/7407/events","html_url":"https://github.com/appium/appium/issues/7407","id":193802952,"number":7407,"title":"Cannot create new session after run few sessions","user":{"login":"rkavalap","id":80310,"avatar_url":"https://avatars.githubusercontent.com/u/80310?v=3","gravatar_id":"","url":"https://api.github.com/users/rkavalap","html_url":"https://github.com/rkavalap","followers_url":"https://api.github.com/users/rkavalap/followers","following_url":"https://api.github.com/users/rkavalap/following{/other_user}","gists_url":"https://api.github.com/users/rkavalap/gists{/gist_id}","starred_url":"https://api.github.com/users/rkavalap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkavalap/subscriptions","organizations_url":"https://api.github.com/users/rkavalap/orgs","repos_url":"https://api.github.com/users/rkavalap/repos","events_url":"https://api.github.com/users/rkavalap/events{/privacy}","received_events_url":"https://api.github.com/users/rkavalap/received_events","type":"User","site_admin":false},"labels":[{"id":143265062,"url":"https://api.github.com/repos/appium/appium/labels/NeedsTriage","name":"NeedsTriage","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-06T15:32:50Z","updated_at":"2016-12-08T01:56:05Z","closed_at":null,"body":"@nghiadhd commented on [Mon Dec 05 2016](https://github.com/appium/appium-android-driver/issues/197)\n\nI wrote a test script to measure long run capability of Appium.\r\nHowever after a few sessions, the appium stub at create new session\r\n\r\n`[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {\"desiredCapabilities\":{\"chromeOptions\":{\"androidPackage\":\"com.android.chrome\",\"androidDeviceSerial\":\"988633304d4b323634\"}}}`\r\n\r\nI used 'adb' to check \"chrome\" process on device and see that many chrome processes are leaking\r\n\r\n```\r\n./adb shell ps | grep chrome                        \r\nu0_a85    2757  3184  1578696 194580 SyS_epoll_ 0000000000 S com.android.chrome\r\nu0_i39    2804  3184  1201756 86092 SyS_epoll_ 0000000000 S com.android.chrome:sandboxed_process0\r\nu0_a85    2836  3184  1212104 93312 SyS_epoll_ 0000000000 S com.android.chrome:privileged_process0\r\nu0_a86    10842 3183  1664788 59756 SyS_epoll_ 0000000000 S com.sec.android.app.chromecustomizations\r\nu0_a85    30465 3184  1548556 182592 SyS_epoll_ 0000000000 S com.android.chrome\r\nu0_a85    30671 3184  1234504 89732 SyS_epoll_ 0000000000 S com.android.chrome\r\n```\r\n\r\nBecause my device is non-root so I cannot kill \"chrome\" process by 'shell pkill' or 'am force-stop com.android.chrome'.\r\nNow my device cannot work with appium any more until restarting to clean up leaking processes\r\n\r\nEnvironment: \r\nAppium: 1.6.1/1.6.2\r\nChromedriver: 2.25\r\nNodejs: v6.8.0\r\nNPM: 3.10.8\r\n\r\nDevice:\r\nGalaxy S7: SM-G930F\r\nAndroid: 6.0.1\r\nChrome: 54.0.2840.85\r\n\r\nStart commands:\r\n- Appium\r\n`node build/lib/main.js --command-timeout \"7200\" --debug-log-spacing --default-capabilities '{\"platformName\":\"Android\"}' --default-device`\r\n\r\n- Client\r\n`UDID=988633304d4b323634 PLATFORM=Android npm run wd`\r\n\r\nAppium's log: https://gist.github.com/nghiadhd/88c8bf0e14ac32f2f47f3e3052d2ddfa\r\nTestscript: https://gist.github.com/nghiadhd/8388fe2b2e9e1917298e0b9d4d52d952\n\n"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/265631134","html_url":"https://github.com/appium/appium/issues/7407#issuecomment-265631134","issue_url":"https://api.github.com/repos/appium/appium/issues/7407","id":265631134,"user":{"login":"nghiadhd","id":661582,"avatar_url":"https://avatars.githubusercontent.com/u/661582?v=3","gravatar_id":"","url":"https://api.github.com/users/nghiadhd","html_url":"https://github.com/nghiadhd","followers_url":"https://api.github.com/users/nghiadhd/followers","following_url":"https://api.github.com/users/nghiadhd/following{/other_user}","gists_url":"https://api.github.com/users/nghiadhd/gists{/gist_id}","starred_url":"https://api.github.com/users/nghiadhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nghiadhd/subscriptions","organizations_url":"https://api.github.com/users/nghiadhd/orgs","repos_url":"https://api.github.com/users/nghiadhd/repos","events_url":"https://api.github.com/users/nghiadhd/events{/privacy}","received_events_url":"https://api.github.com/users/nghiadhd/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T01:56:05Z","updated_at":"2016-12-08T01:56:05Z","body":"Thanks @rkavalap \r\n\r\nActually, it doesn't get lock, I still can open chrome and use normally by manual (hand). However\r\nwhen I goto \"cached running process\". I found it has 3 chrome processes, I tried to close them but not success\r\nNow, only one workaround solution is set \"limit background process\" to \"no background process\" to kill them\r\n\r\nI'll investigate the chromedriver source, may it help me find the root cause"}}
{"actor":{"display_login":"nghiadhd"}}