下班的时候开始执行,第二天来的时候发现没跑完,appium各种异常,后来看了appium的log发现是内存溢出了,报错如下:
<--- Last few GCs --->
[68480:0x102845000] 22938475 ms: Mark-sweep 4085.6 (4104.9) -> 4085.6 (4104.9) MB, 54.7 / 0.0 ms (average mu = 0.957, current mu = 0.000) last resort GC in old space requested
[68480:0x102845000] 22938532 ms: Mark-sweep 4085.6 (4104.9) -> 4085.6 (4104.4) MB, 56.5 / 0.0 ms (average mu = 0.922, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x57e8fedbe3d]
Security context: 0x078c1981e6e9
1: test [0x78c19809561](this=0x078c4a932069 >,0x078c1f607219 )
2: truncate [0x78ccb9c31a9] [/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/lodash/lodash.js:~15070] [pc=0x57e90fd3b85](this=0x078c14...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0x10003d035 node::Abort() [/usr/local/bin/node]
2: 0x10003d23f node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
3: 0x1001b8e15 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0x100586d72 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
5: 0x100590274 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
6: 0x100561b25 v8::internal::Factory::NewRawOneByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
7: 0x100693c38 v8::internal::String::SlowFlatten(v8::internal::Handle, v8::internal::PretenureFlag) [/usr/local/bin/node]
8: 0x100779c08 v8::internal::RegExpImpl::IrregexpExec(v8::internal::Handle, v8::internal::Handle, int, v8::internal::Handle) [/usr/local/bin/node]
9: 0x10081c670 v8::internal::Runtime_RegExpExec(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
10: 0x57e8fedbe3d
Abort trap: 6
于是上网找了以下的几种方式:
1.使用终端运行appium ,并且把appium内存扩展到4096MB
我的是:node --max_old_space_size=4096 /Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js -p 4723
2.logcat.js文件注释push
附上当时eclipse的报错:
1、
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: Error: read ECONNRESET
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'ruby-Mac.local', ip: 'fe80:0:0:0:69:1eb2:920:7aaf%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '12.0.2'
Driver info: io.appium.java_client.ios.IOSDriver
2、
org.openqa.selenium.NoSuchSessionException: Session does not exist
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'ruby-Mac.local', ip: 'fe80:0:0:0:69:1eb2:920:7aaf%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '12.0.2'
Driver info: io.appium.java_client.ios.IOSDriver