marioparaschiv / nitro-sniper

πŸ”« A lightweight, fast and efficient discord nitro sniper, giveaway sniper & invite sniper.
821 stars 3.23k forks source link

[Bug] Heap out of memory #288

Closed uniedit closed 3 years ago

uniedit commented 3 years ago

Describe the bug

JavaScript runs out of memory with 80 tokens.

To Reproduce

Launch the sniper with the settings provided and 80 alternate accounts.

Expected behavior

Memory to be purged/optimized every now and then.

Please provide your snipers settings.

{
   tokens: {
      // Main Token (ex: Nz...)
      main: '',
      // Alt Tokens (ex: Nz...)
      alts: [
         '',
      ],
   },
   // The mode to run the sniper in. Options: main (only main account), alts (only alts), both
   mode: 'both',
   /*
      The status the accounts should be on.
      Options: online, dnd, idle, offline, default
      default means the status will not be modified.
   */
   status: {
      // The status the main account will have IF it's logged in
      main: 'default',
      // The status the logged in alts will have
      alts: 'default'
   },
   nitro: {
      // The amount of nitros needed to be sniped for the cooldown to activate
      max: 2,
      // Cooldown to activate after max nitro has been hit (in hours)
      cooldown: 24,
      dm: {
         /*
          * How long to wait before attempting to claim the nitro in DMs (in seconds)
          * This is to avoid suspicion when winning giveaways by slowing down the sniper from instantly sniping it.
          */
         delay: 10
      }
   },
   giveaway: {
      // Wether or not to activate the giveaway sniper (true/false)
      enabled: false,
      // Delay to react to the giveaway (in seconds)
      delay: 30,
      // DM the hoster on giveaway win (true/false)
      dm: true,
      // Messages to DM the host
      dmMessages: [
         'Hey, i won the giveaway.',
         'Could i redeem my prize?'
      ],
      // How long to wait to DM (in seconds)
      dmDelay: 25,
      // How long to wait between messages (in seconds)
      messageDelay: 2,
      // Blacklisted words for giveaway prizes
      blacklistedWords: [
         'bot',
         'test',
         'ban'
      ],
      // Only react to whitelisted giveaway prizes (true/false)
      whitelistOnly: false,
      // Whitelisted words for giveaway prizes
      whitelistedWords: [
         'nitro'
      ],
      // Blacklisted Server IDs to not snipe giveaways on
      blacklistedServers: [
         ''
      ],
      // Only snipe giveaways on whitelisted servers (true/false)
      whitelistServersOnly: false,
      whitelistedServers: [
        ''
      ]
   },
   invite: {
      // Wether or not to activate the invite sniper (true/false)
      enabled: false,
      delay: {
         // Minimum delay to join the server (in seconds)
         min: 10,
         // Maximum delay to join the server (in seconds)
         max: 20
      },
      members: {
         // The minimum member count the server should have
         min: 1500,
         // The maximum member count the server should have
         max: 50000
      },
      // The amount of joined invites needed for the cooldown to activate
      max: 10,
      // Cooldown to activate after max joined invites has been hit (in hours)
      cooldown: 6,
      // Wether to accept an invite on any other alt/account (depends on "mode") if the current alt has max servers (true/false)
      queue: true,
      // Wether to allow the main token to snipe invites ONLY if sniper mode is set to "both" (true/false)
      onlyAlts: true
   },
   webhook: {
      // URL to fire webhook to for notifications (ex: https://discord.com/api/webhooks/.../...)
      url: '',
      enabled: {
         // Fire webhook on invalid code (true/false)
         codeInvalid: true,
         // Fire webhook on already redeemed code (true/false)
         codeAlreadyRedeemed: true,
         // Fire webhook on sniped code (true/false)
         codeSuccess: true,
         // Fire webhook on giveaway enter (true/false)
         giveawayEntered: true,
         // Fire webhook on giveaway win (true/false)
         giveawayWin: true,
         // Fire webhook on invite join (true/false)
         inviteJoin: false,
         // Fire webhook on failure of sniping invite (true/false)
         inviteFail: false
      },
      mentionEveryone: {
         // Mention on invalid code (true/false)
         codeInvalid: false,
         // Mention on already redeemed code (true/false)
         codeAlreadyRedeemed: false,
         // Mention on sniped code (true/false)
         codeSuccess: true,
         // Mention on giveaway enter (true/false)
         giveawayEntered: false,
         // Mention on giveaway win (true/false)
         giveawayWin: true,
         // Mention on invite join (true/false)
         inviteJoin: false,
         // Mention on failure of sniping invite (true/false)
         inviteFail: false
      }
   }
}

What platform are you seeing the problem on?

Repl.it

Relevant log output if applicable.

ξΊ§ bash main.sh

                                           β•“β•–,
               g▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄╬╣╣╣╒╬Nβ•–
              ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓╣╣╣╣╣╣╣╣╣╒╣╣@,
               β–€β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β•£β•£β•£β•£β•£β•£β•£β•’β•’β•£β•£β•£β•£β•£@,
                        β•™β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β•£β•£β•£β•£β•£β•£β•’β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£W
                        g▓▓▓▓▓▓╒▓▓▓▓╩╨╨╩╬╣╒╣╒╣▒╣╣╣╣╣╣╣╣╣╣╣╣
 Γ†β–“β–“β–“β–“βŒ   β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β•’β–“β–“β•βŒ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•™β•¨β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£
 β•™β–€β–“β–“β–€    β•™β–€β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β•’β–“β–“β•©β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•™β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£@
                     β–“β–“β–“β–“β•’β–“β–“β–‘β–‘β–‘β–‘β–‘β•“β•’β–’β–’β–’β–’β–’β–’β•’β–‘β–‘β–‘β–‘β–‘β•™β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•’
               gβ–„β–„β–„β–„β–„β–“β–“β–“β–“β–“β–“Γ‘β–‘β–‘β–‘β–‘β•‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β•–β–‘β–‘β–‘β–‘β•‘β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£βŒ
              β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘β•‘β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–‘β–‘]β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£βŒ
               ╙╙▐▓▓▓▓▓▓▓▓▓@β–‘β–‘β–‘β–‘β•™β–’β–’β–’β–’β–’β–’β–’β–’β–’β–’β•œβ–‘β–‘β–‘β–‘β•‘β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£
                  β–“β–“β–“β–“β–“β–“β–“β•£β–“β–“β–‘β–‘β–‘β–‘β–‘β•™β–’β–’β–’β–’β–’β–’β–’β–’β–‘β–‘β–‘β–‘β–‘β•“β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£Γ‘
                  β•šβ–“β–“β–“β–“β–“β–“β–“β–“β–“β–“@β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•’β•£β•£β•£β•£β•£β•£β•£β•£β•£β•£
                   ▐▓▓▓▓▓▓▓▓╒▓▓@Β΅β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•“@β–‘β–‘β–‘β–‘β–‘β–‘β•™β•£β•£β•£β•£β•£β•£β•’`
                    β•™β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β•’β–“β–“β–“β–“@@@@β–“β–“β–“β–“β•’β–“β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•œβ•¨β•£β•’β–‘
                      β–€β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–„β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–’
                         β–€β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β•œ"β–‘β–’β–‘"
                           β–€β–€β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–€β•©
                               β•™β•™β–€β–€β–€β–“β–“β–“β–“β–€β–€β–€β•™β•™

[2021-10-27 02:29:00] Success | Code: 3mWpcYg6nBYdYFF9 | Nitro Monthly | GhostCap Gaming > #general | pedrotski#1184 | 546ms

<--- Last few GCs --->

[2222:0x59965e0]   400809 ms: Scavenge 240.5 (250.6) -> 239.7 (250.6) MB, 1.5 / 0.0 ms  (average mu = 0.775, current mu = 0.800) allocation failure 
[2222:0x59965e0]   400830 ms: Scavenge 240.6 (250.6) -> 239.7 (250.6) MB, 1.3 / 0.0 ms  (average mu = 0.775, current mu = 0.800) allocation failure 
[2222:0x59965e0]   400934 ms: Scavenge 240.7 (250.6) -> 239.8 (250.6) MB, 1.6 / 0.0 ms  (average mu = 0.775, current mu = 0.800) allocation failure 

<--- JS stacktrace --->

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
 1: 0xa389b0 node::Abort() [node]
 2: 0x96e0af node::FatalError(char const*, char const*) [node]
 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd73fd5  [node]
 6: 0xda496e v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [node]
 7: 0xdb09a6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [node]
 8: 0xd9cb3f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [node]
 9: 0xd9cdb8 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [node]
10: 0xd8f699 v8::internal::ItemParallelJob::Run() [node]
11: 0xdb2900 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [node]
12: 0xdb319c v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [node]
13: 0xdb3365 v8::internal::MarkCompactCollector::Evacuate() [node]
14: 0xdc5361 v8::internal::MarkCompactCollector::CollectGarbage() [node]
15: 0xd81628 v8::internal::Heap::MarkCompact() [node]
16: 0xd83118 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
17: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
18: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
19: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
20: 0x1446379  [node]
mte0 commented 3 years ago

got thte same isssue, currently remaking the repl to see if it fixes

mte0 commented 3 years ago

how many tokens do you have

uniedit commented 3 years ago

how many tokens do you have

80

uniedit commented 3 years ago

got thte same isssue, currently remaking the repl to see if it fixes

i will try