I can try to fix.
|
I will pay the money first, you must be a well known/respected member here.
I'm asking for a FULL fix and maximized stability.
Im willing to pay 20$ to for the same he wants
Look at my project thread, I have it fixed. Pm me your msn.
PM me your MSN, I'l fix.
Btw, brkownz, you can't just try { and } catch it, you need to add a garbage collector. (Just a small tip)
Made a simple memory leak.
Code:import java.util.ArrayList; import java.util.List; public class Memory_leak { private static List<Integer> memoryLeak = new ArrayList<Integer>(); public static void main(String args[]){ int counter = 0; int garbageCollected = 0; while (true){ try { Integer payload = new Integer(counter); memoryLeak.add(payload); counter++; //USE THE CODE HERE! if(memoryLeak != null){ memoryLeak.remove(payload); garbageCollected++; } } catch(java.lang.OutOfMemoryError e){ System.out.println("Memory leak: collected "+garbageCollected); System.exit(1); } } } }
Can u explain me why this is a memory leak , I dont realy get it
You make an arraylist
create 2 variables and set them to 0
then make an infinite loop
in which u make payload equal to counter (0)
u add payload( = 0) to the arraylist
then u remove the index 0 from the arraylist
It doesnt only add 0, it goes up , every 600 ms, there's a
the yellow zone, is where you can use your code.Code:counter++;
try running it without
and see the difference.Code:if(memoryLeak != null){ memoryLeak.remove(payload); garbageCollected++; }
I've not looked at DSPK, but by the things you're making to fix this 'memory leak' I can already tell it's fucking awful.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |