> Robert Klemme napisal(a):
>>> Well, it is not shown in my post but after static method forks
[quoted text clipped - 11 lines]
> So, do you think that 'static' can have anything to do with this? Would
> you recommend memory profiling?
Well, you can do that. Maybe you find out it's not the large array you
suspect but some completely unrelated other piece of code which is
responsible for the OOME. You might as well try running in the debugger
which will easily tell you whether threads do actually terminate the way
you intend / think.
> As for active threads at a time - yes, this number is limited and this
> number is constant at any point of execution, this is not a "pool"
> model where number of threads would be dependent on data being
> processed.
Note, typically it is the pool models that limit the number of threads.
At the moment it is practically next to impossible to come up with more
advice because we know too little of your code / problem.
Regards
robert
Marcin Rzeznicki - 29 Oct 2006 13:14 GMT
Robert Klemme napisal(a):
> > Hi Robert, thanks for your reply.
> > So, do you think that 'static' can have anything to do with this? Would
[quoted text clipped - 5 lines]
> which will easily tell you whether threads do actually terminate the way
> you intend / think.
Yes, possibly - I think that this is the best way to go
> > As for active threads at a time - yes, this number is limited and this
> > number is constant at any point of execution, this is not a "pool"
> > model where number of threads would be dependent on data being
> > processed.
>
> Note, typically it is the pool models that limit the number of threads.
Total, yes - but number of active threads depend on data (bounded by
pool size) I think eg. in model with a shared queue where pooled
threads sleep waiting for items to be processed and choose it for
processing with round robin fashion. Number of active threads then is
determined indirectly by "load factor" of the queue. This is not my
case - in my problem number of active threads is limited and constant,
it does not matter how many items are in the array, there is always
predefined number of threads working
> At the moment it is practically next to impossible to come up with more
> advice because we know too little of your code / problem.
Yes, I am aware of that. Actually only problem I want to solve with
your kind help is whether fact that method in question is static might
be causing any problems. How do you think?
ert
Robert Klemme - 29 Oct 2006 16:44 GMT
> Yes, I am aware of that. Actually only problem I want to solve with
> your kind help is whether fact that method in question is static might
> be causing any problems. How do you think?
> ert
Static methods are no different with regard to GC than non static ones. It
all depends on what objects they create and where they store references.
You can create a memory leak with a static as well as with a non static
method.
robert