
TheGoldenPotato
Member-
Posts
11 -
Joined
-
Last visited
Everything posted by TheGoldenPotato
-
Question JavaScript heap out of memory
TheGoldenPotato replied to TheGoldenPotato's topic in node-steam-tradeoffer-manager
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. -
Question JavaScript heap out of memory
TheGoldenPotato replied to TheGoldenPotato's topic in node-steam-tradeoffer-manager
Well...... God damn it. Thanks for the response. I'll respond if I find the issue. -
Question JavaScript heap out of memory
TheGoldenPotato replied to TheGoldenPotato's topic in node-steam-tradeoffer-manager
But I have 16GBs of RAM on my computer, and it crashes near 1.6GB -
Question JavaScript heap out of memory
TheGoldenPotato posted a topic in node-steam-tradeoffer-manager
<--- 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. -
Do you use SDA, (Steam Desktop Authenticator) ?. If so, do you have the File -> Settings -> Auto-Confirm trades enabled?
-
Well, this is really weird. Maybe some node modules might be doing this? I would make sure that you are only using official modules, like the ones made by DrMckay. Maybe you are using a node module which has a backdoor in it. I don't know if that is even possible, but someone more educated about Node.js might be able to tell
-
Hmm. Good question. I didn't really think through that answer . But there must have been a backdoor in that bot, as someone cannot just extract your whole inventory, without you noticing.
-
Yeah, I thought that might be the cause. If you downloaded it from a site, and even worse if it was leaked, the author may have added a backdoor in the code, which allows him/her to extract the content of your bot with a simple command. Some even include advanced anti-theft in their code, which makes your bot message the owner if it was taken in use by someone who obtained it in an illegal way, leaking as an example.
-
Did you make this bot? Did you download it from github? Or did you buy it from a person?
-
But when I tried the solution which was posted in that thread, it still says NaN in the message. My code looks like this now. client.on("friendRelationship", (SENDER, REL) => { client.getPersonas([SENDER], function(personas) { var persona = personas[SENDER.getSteamID64]; var name = persona ? persona.player_name : ("[" + SENDER.getSteamID64 + "]"); if (REL === 2) { client.addFriend(SENDER); } else if (REL === 3) { if (CONFIG.INVITETOGROUPID) { client.inviteToGroup(SENDER, CONFIG.INVITETOGROUPID); } client.chatMessage(SENDER, + name + CONFIG.MESSAGES.WELCOME); } }); });
- 2 replies
-
- node.js
- node-steam-user
-
(and 1 more)
Tagged with:
-
Hello, I am trying to make my bot say people's names, and then a welcome message. But currently with the code that I got, it only says "NaN Hello, I am a generous Trading Bot, I would love to trade with you, but I am currently in maintenance mode. Check back later.". I do not know why it says NaN, instead of the user's name. My current code looks like this client.on("friendRelationship", (SENDER, REL) => { client.getPersonas([client.steamID], (personas) => { if (REL === 2) { client.addFriend(SENDER); } else if (REL === 3) { if (CONFIG.INVITETOGROUPID) { client.inviteToGroup(SENDER, CONFIG.INVITETOGROUPID); } client.chatMessage(SENDER, + personas + CONFIG.MESSAGES.WELCOME); } }); });
- 2 replies
-
- node.js
- node-steam-user
-
(and 1 more)
Tagged with: