Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > J2ME, continusly load image, low speed....

Reply
Thread Tools

J2ME, continusly load image, low speed....

 
 
Boki
Guest
Posts: n/a
 
      10-24-2005
Hi All,
It seems that speed will become slower and slower after a while.

Could you please advice?
The image A / B are both 5KB size jpg file.

Best regards,
Boki.

====================
public void run()
{

int hhhhh=0;
lastSendTime=System.currentTimeMillis() ;
//////////////////////////////
while(got_ate0<100)
{


if (System.currentTimeMillis() - lastSendTime > 120)
{
lastSendTime=System.currentTimeMillis() ;


hhhhh=1-hhhhh;

try {
if (hhhhh==0)
GUI.aaimage = Image.createImage("/2.jpg");
else
GUI.aaimage = Image.createImage("/1.jpg");

}
catch (Exception e)
{
}
got_ate0++;
gui.repaint();

}
}


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-24-2005
Boki wrote:

> Could you please advice?


My advice is 'post compilable code'.

> The image A / B are both 5KB size jpg file.


Have you ruled out 'image caching'?
Check the freeMemory/totalMemory* each iteration.

* Yes, yes. Listed in the JavaDocs.
 
Reply With Quote
 
 
 
 
David N. Welton
Guest
Posts: n/a
 
      10-24-2005
Boki wrote:
> I don't know how to check
>
> " freeMemory/totalMemory* each iteration"


>>* Yes, yes. Listed in the JavaDocs.


Google turns this up as the third hit:

http://java.sun.com/j2se/1.4.2/docs/...g/Runtime.html

--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/
 
Reply With Quote
 
Boki
Guest
Posts: n/a
 
      10-24-2005
I don't know how to check

" freeMemory/totalMemory* each iteration"

..... I am using Sony Ericsson WTK toolbar / Netbeans 4.1/5.0

Why I do this is to simulate when I got a lot of jpg file ( from
Bluetooth ), can I decode/render in screen on time....


Best regards,
Boki.


"Andrew Thompson" <(E-Mail Removed)>
???????:Vr67f.26577$(E-Mail Removed)...
> Boki wrote:
>
>> Could you please advice?

>
> My advice is 'post compilable code'.
>
>> The image A / B are both 5KB size jpg file.

>
> Have you ruled out 'image caching'?
> Check the freeMemory/totalMemory* each iteration.
>
> * Yes, yes. Listed in the JavaDocs.



 
Reply With Quote
 
Boki
Guest
Posts: n/a
 
      10-24-2005
Thanks, I think the root cause is - create , create , create.... , right?

I don't know which command can replace the data directly without create a
new memory space?


"David N. Welton" <(E-Mail Removed)>
???????:(E-Mail Removed)...
> Boki wrote:
>> I don't know how to check
>>
>> " freeMemory/totalMemory* each iteration"

>
>>>* Yes, yes. Listed in the JavaDocs.

>
> Google turns this up as the third hit:
>
> http://java.sun.com/j2se/1.4.2/docs/...g/Runtime.html
>
> --
> David N. Welton
> - http://www.dedasys.com/davidw/
>
> Linux, Open Source Consulting
> - http://www.dedasys.com/



 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      10-25-2005
On Mon, 24 Oct 2005 22:26:53 +0800, "Boki" <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

> It seems that speed will become slower and slower after a while.
>
>Could you please advice?


That is often a packratting problem.

See http://mindprod.com/jgloss/packratting.html

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Darryl L. Pierce
Guest
Posts: n/a
 
      10-26-2005
Boki wrote:
> Thanks, I think the root cause is - create , create , create.... , right?
>
> I don't know which command can replace the data directly without create a
> new memory space?


Images are immutable, so you have to create a new instance for each new
Image used.

--
Darryl L. Pierce <(E-Mail Removed)>
Homepage: http://mcpierce.multiply.com/
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pcos low carb diet. Low carb diet program. Cholesterol low carb diet.Low carb diet foods. zyraco C++ 0 11-10-2009 01:44 PM
Low carb diabetes diet. Low fat high carb diet. The low carb diet.Low carb diet pregnancy. zyraco C++ 0 11-10-2009 01:44 PM
Low carb calorie diet. No low carb diet. Free low carb diet. Low carbdiet meal plan. zyraco C++ 0 11-10-2009 01:44 PM
Low Fat, Low Carb, Low Calorie and every other crazy fad diet youhave tried. ruxandra C++ 0 04-14-2009 07:00 PM
J&K Cameras prices very low, maybe too low DEP Digital Photography 11 12-25-2003 04:45 PM



Advertisments