May 26, 20178 yr There's a memory leak in this script, but can't find it. boolean isSplashing; long magicxp; private Predicate<NPC> suitableNPC = n -> getMap().canReach(n) && n.getHealthPercent() > 0 && n.hasAction("Attack") && !n.isUnderAttack() && getMap().realDistance(n) < 15; public int onLoop() throws InterruptedException { isSplashing = true; magicxp = getSkills().getExperience(Skill.MAGIC); sleep(random(3600,4800)); if (magicxp == getSkills().getExperience(Skill.MAGIC)) { isSplashing = false; } if (!myPlayer().isUnderAttack() || !isSplashing) { if (getInventory().contains("Air rune") && getInventory().contains("Mind rune") && getInventory().contains("Fire rune")) { java.util.List<NPC> npcs = getNpcs().getAll().stream().filter(suitableNPC).collect(Collectors.toList()); if (!npcs.isEmpty()) { npcs.sort(Comparator.<NPC>comparingInt(a -> getMap().realDistance(a)).thenComparingInt(b -> getMap().realDistance(b))); if (npcs.get(0).interact("Attack")) { sleep(random(3000)); } } sleep(random(3000,4000)); } else { stop(); } } return random(300,400); } Threw some stuff around to see if something changed. In like 4-5 hours the memory usage went from 600MB to 1.2GB.
May 26, 20178 yr why do you have complex checks for splashing if all you really need is check closest npc check if not interacting autocast splash spell type in clan chat 3-5 mins might be the checks idk for sure
May 26, 20178 yr Im having the same issue using a script @Shudsy made for me. I thought it was the script aswell but it could be a client issue if more than a few people are having this problem
May 26, 20178 yr 39 minutes ago, toogsi said: Im having the same issue using a script @Shudsy made for me. I thought it was the script aswell but it could be a client issue if more than a few people are having this problem Your script had a massive CPU usage because you got a NPE.
May 26, 20178 yr Author 1 hour ago, raijin said: why do you have complex checks for splashing if all you really need is check closest npc check if not interacting autocast splash spell type in clan chat 3-5 mins might be the checks idk for sure What is complex in your eyes?
May 26, 20178 yr 1 minute ago, The Undefeated said: What is complex in your eyes? nothing really just dont think you need a list for 1 target private Predicate<NPC> suitableNPC = n -> getMap().canReach(n) && n.getHealthPercent() > 0 && n.hasAction("Attack") && !n.isUnderAttack() && getMap().realDistance(n) < 15; java.util.List<NPC> npcs = getNpcs().getAll().stream().filter(suitableNPC).collect(Collectors.toList()); if (!npcs.isEmpty()) { npcs.sort(Comparator.<NPC>comparingInt(a -> getMap().realDistance(a)).thenComparingInt(b -> getMap().realDistance(b)));
May 26, 20178 yr Author 4 minutes ago, raijin said: nothing really just dont think you need a list for 1 target private Predicate<NPC> suitableNPC = n -> getMap().canReach(n) && n.getHealthPercent() > 0 && n.hasAction("Attack") && !n.isUnderAttack() && getMap().realDistance(n) < 15; java.util.List<NPC> npcs = getNpcs().getAll().stream().filter(suitableNPC).collect(Collectors.toList()); if (!npcs.isEmpty()) { npcs.sort(Comparator.<NPC>comparingInt(a -> getMap().realDistance(a)).thenComparingInt(b -> getMap().realDistance(b))); Oh yeah, copied it from Macro killer, just because I was that lazy. But still doesn't fix the memory leak.. Edited May 26, 20178 yr by The Undefeated
May 26, 20178 yr Author Thanks to @Bamboozled for solving my problem. I had no sound drivers installed on my server, turned off the sound and it was fixed.
May 27, 20178 yr 6 hours ago, The Undefeated said: Thanks to @Bamboozled for solving my problem. I had no sound drivers installed on my server, turned off the sound and it was fixed. wtf LOL. Was it really fucking sound drivers LOL.
May 27, 20178 yr Just now, Phaibooty said: wtf LOL. Was it really fucking sound drivers LOL. I mean i can just see tens of thousands of error logs piling up in memory from rs constantly sending sounds
Create an account or sign in to comment