Jump to content
McKay Development

TheGoldenPotato

Member
  • Posts

    11
  • Joined

  • Last visited

Community Answers

  1. TheGoldenPotato's post in JavaScript heap out of memory was marked as the answer   
    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.
×
×
  • Create New...