[Red5devs] StreamUtils class and ServerStream
Mikael Kopteff
mikael.kopteff at floobs.com
Fri Jun 6 06:10:55 PDT 2008
Hey,
there are couple of functionalities from red5, that I don't fully
understand, like org.red5.server.api.stream.support.StreamUtils -class.
I have used this class to create my ServerStreams, but after I
excplicitly call the close() -method on the serverstream it is not
removed from the map that stores the serverstreams in the StreamUtils
-class. This means, that it is still returned when you call
StreamUtils.getServerStream(scope, name), even if the stream is closed.
The ServerStream instance is never destroyed, becouse the StreamUtils
map has a references to the ServerStream object and objects from this
private map are never destroyed. Doesn't this qualify as a bad memory
management? If you open an x amount of ServerStreams, the map holds an x
amount of ServerStream objects, uselessly consuming memory, eventhough
they are not streaming. Also, there is no way of opening this closed
stream, and the only option is to open a new ServerStream on top of the
closed ServerStream. Does this affect anything in a negative way? I am
now currently using my own class to create and retrive the streams, that
also removes them from my own map. Does red5 need the ServerStream
references in StreamUtils map for something? Can I use my own class to
create, retrive and delete the ServerStreams?
Is there something I am missing?
Another question is that, if I am using the ServerStream object to wrap
another stream (use it as a source using SimplePlayItem), does this
consume twice as much resources, does red5 copy the source stream or
just use ithe source stream as an input?
I would really appriciate any help and clarification on the matters?
Thanks a bunch!
Mikael Kopteff
More information about the Red5devs
mailing list