TheGoldenPotato Posted September 19, 2017 Report Posted September 19, 2017 (edited) <--- Last few GCs ---> [9212:00000230BE791410] 222793 ms: Mark-sweep 1416.0 (1509.0) -> 1416.0 (1493.0) MB, 908.0 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 908 ms) last resort [9212:00000230BE791410] 223709 ms: Mark-sweep 1416.0 (1493.0) -> 1416.0 (1493.0) MB, 915.3 / 0.0 ms last resort <--- JS stacktrace ---> ==== JS stack trace ========================================= Security context: 000002048E91CEA9 <JSObject> 1: new constructor(aka EconItem) [C:\Users\*****\Documents\*********\*********\node_modules\steam-tradeoffer-manager\lib\classes\EconItem.js:~5] [pc=0000033EC5C265F2](this=000001FA21AD43E1 <EconItem map = 000001340AAE4441>,item=000003D861277141 <Object map = 00000127A0FEE2B9>) 4: /* anonymous */(aka /* anonymous */) [C:\Users\*********\Documents\*********\*********\node_modules\steam-tradeof... FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memoryI have no idea why this is happening. Started about two-three days ago. Edited September 19, 2017 by TheGoldenPotato Quote
TomYoki Posted September 19, 2017 Report Posted September 19, 2017 Pretty sure that's memory (Ram) issue? Quote
TheGoldenPotato Posted September 19, 2017 Author Report Posted September 19, 2017 But I have 16GBs of RAM on my computer, and it crashes near 1.6GB Quote
Axle Posted September 20, 2017 Report Posted September 20, 2017 Memory leak. You probably fucked up an infinite/recursive call stack somewhere that keeps adding, NodeJS itself has a call stack size limit. I can't remember the number off the top of my head but it is kinda low, you can manually raise it somehow if you need to. My own script barely takes ~80MB of RAM and it is mainly because I don't run it as a daemon, its the only thing I have running on a dedicated machine so I choose not to. Quote
TheGoldenPotato Posted September 20, 2017 Author Report Posted September 20, 2017 Well...... God damn it. Thanks for the response. I'll respond if I find the issue. Quote
TheGoldenPotato Posted September 20, 2017 Author Report Posted September 20, 2017 (edited) Well I found the problem. My code misused Steam-TradeOffer-Manager/lib/assets.js . It somehow just keeps on running the code at line 46, which is for (let i in cache[key]) { if (cache[key].hasOwnProperty(i)) { item[i] = cache[key][i]; } } It just kept on running it until my program reached around 1600-1800MB in RAM usage, and then crashed. I kinda makeshift fixed it, by doing so with the code. TradeOfferManager.prototype._mapItemsToDescriptions = function(appid, contextid, items) { var cache = this._assetCache; if (!(items instanceof Array)) { items = Object.keys(items).map(key => items[key]); } return items.map((item) => { item.appid = appid || item.appid; item.contextid = contextid || item.contextid; var key = `${item.appid}_${item.classid}_${item.instanceid || '0'}`; if (!cache[key]) { // This item isn't in our description cache return new EconItem(item); } /* for (let i in cache[key]) { if (cache[key].hasOwnProperty(i)) { item[i] = cache[key][i]; } } */ return new EconItem(item); }); }; The program now runs at around 200MB instead of 500MB and then randomly peaking to godly amounts. Edited September 20, 2017 by TheGoldenPotato Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.