I have been trying to find a Java
queue implementation with a special size limit. In contrast to the usual size parameter that limits the count of objects in the queue, I need to limit the queue's maximum memory usage (in bytes). The queue would be used to hold objects of very different sizes, some huge and some very small. I.e. the queue would hold only small amount of large objects and bigger amount of smaller objects.
Another possibility would be a queue with a size parameter in insert methods. When adding a new element to the queue I could specify how big the object to be added is.
Would anyone know of such Java
queue implementation?
Thanks!