queue - Java Outofmemory heap space error: How do I make a deque from a vector? -
I'm new to Java and really need your help.
I am currently using a queue, a receiver thread places data in this queue and pars reads from this. But the problem is that the receiver can get at incredible speed, eg. 3000 / sec, while the parser parses only 100 / second.
Edit: I've checked, the queue stays in the first 100 or so, and starts after ten seconds 100 increments per second, and 2000 accidents are either Is it possible that the memory leak?
My code (in a tight loop)
byte [] data = new byte [1024]; System.arraycopy (udpPacket.getData (), 0, data, 0, 1024); Queue.offer (data);
The heap is filled very quickly, and I get an exception to the exception. I think the problem is that the queue is created using a linked list, and all the signals should be saved in the pile.
I know the C edition which does the same thing (using buffer), but better performance, but due to deployment issues, we can only use Java.
If you run 3000 / sec but only 100 / second process sooner or later you run out of memory Will I suggest that you use more threads for parsing?
In relation to queue, have a look and see both high-performance thread-safe queue deployment.
Comments
Post a Comment