XML Feeds

.

[java-dev] Re: Re: Crash in JitterMatrix.copyMatrixToArray() ?

volker böhm vboehm at gmx.ch
Fri Feb 8 05:59:25 MST 2008


On 07 Feb 2008, at 23:07, Joshua Kit Clayton wrote:

>
> On Feb 7, 2008, at 12:37 PM, vboehm at gmx.ch wrote:
>>
>> hmm, interesting. i didn't know about copyArrayToMatrix() - must  
>> have slipped in unnoticed somewhere inbetween.
>> i was using copyArrayToVector() before and it works fine, as you  
>> said.
>> on a speed comparison however, i was happy to notice that  
>> copyArrayToMatrix() is much faster than the vector method - at  
>> least in my situation. cpu usage came down half way for a 100x100  
>> matrix (measured with top).
>>
>> BUT, i can't escape the memory leak even if the array and the  
>> matrix match in size!
>> in the simplified example below, memory is still leaking. where am  
>> i going wrong?
>> any help is welcome, since the speed increase could be crucial to  
>> the project i am working on.
>
> Sorry, copyArrayToMatrix() *always* leaks in Jitter 1.6.x. It is  
> copyMatrixToArray() which has no memory leak if matched in size.

ah, my bad. didn't get you were talking about the other direction only.

>
> The one thing you might be able to hack together now is the  
> creative use of one large array being sent into a single row matrix  
> to jit.scanwrap to wrap that long row into a 2d matrix.

that's a good one!
a quick test shows not as good results as with copyArrayToMatrix(),  
but it's significantly faster than calling copyArrayToVector() for  
each row in the output image.
thanks, would have never thought of that myself.
volker.




More information about the java-dev mailing list