[jacorb-developer] Delay in serial communication

Rob Ratcliff rrr6399 at futuretek.com
Thu Jul 26 14:17:18 CEST 2012


Kujtim (et al):

On 07/26/2012 05:04 AM, Steve Osselton wrote:
> Might be worth taking look at what is causing the delay by using some sort
> of
> Java profiling tool (such as JPROF).
You might want to take a look at jvisualvm as well. Its a terrific tool for CPU and  memory performance profiling and its bundled
with the JDK.
> In general Java isn't a great choice for applications that need
> deterministic behaviour,
> as essentially stuff such as garbage collection makes Java pretty non
> deterministic.
> Would be better with a C++ ORB (OmniORB/TAO are both free/open source)
> or better still a C ORB <blatent plug> such as eORB/C </blatent plug>.

In regards to Java and real time usages, for the non-RT implementation of Java, I can see some delays  on the order of microseconds
or milliseconds, but IMO delays of seconds points to some other problem than garbage collection. I've used Java for many years to
communicate with serial devices (using RXTX) and playing audio and other streaming data and have never had a significant delay issue
in regards to garbage collection. (An easy way to see if garbage collection is an issue is to just increase your maximum memory to
something large and see if there is any change. You can monitor the garbage collection in jvisualvm as well.)

This sounds more like a timeout from say attempting to communicate with DNS or a threading issue. If you take the serial port
communication out of the equation, do you get millisecond responses from the JacORB side. (You should be seeing sub-millisecond
responses to a simple "void ping()" method say.)

Rob


> Cheers Steve.
>
> On 26 July 2012 10:53, Kujtim Hyseni <kujtimhyseni at hotmail.com> wrote:
>
>> On date 29 March 2012 I posted the following message at JacORB mailing
>> list:
>>
>> "Hello,
>>
>> for my project I heave developed a class (implementation class) which
>> forwards requests (operations) from client to serial port, waits for
>> response, receives the response and sends it back to client but it takes a
>> long time to perform it. It delays in receiving the response from serial
>> port. For communication with serial port I have developed a dedicated class
>> which implements Runnable and SerialPortEventListener classes. My class
>> communicates serially with 8051 microcontroller. Again, it seems that class
>> delays in receiving the byte stream from microcontroller. Microcontroller
>> has a built in serial port while my PC uses USB-to-Serial cable. When I
>> communicate microcontroller with the class from usual Java program (from
>> main() routine) it works fine and it takes less than a second to receive
>> the response back.
>>
>> I did some measurements (100 requests) in two ways. In the first,
>> communication class is external and is instantiated from implementation
>> class. In the second, communication class is merged with implementation
>> class. The results are: for first way average response time 9.33266
>> seconds, minimal response time 4.984 seconds while maximal response time
>> 18.015 seconds; for second way average response time 8.62625 seconds,
>> minimal response time 4.969 seconds while maximal response time 16.015
>> seconds. These values are unacceptable for real time applications and raise
>> the question for using JacORB further.
>>
>>
>> What do you think and suggest about?"
>>
>> Then I got various suggestions (from Nick Cross) such: to install JacORB
>> 3.0 and provide the code samples.
>>
>> I now installed JacORB 3.0 and made the same tests, but, received the same
>> delays - just to illustrate for 5 requests times are (in seconds): 6.735,
>> 12, 8, 7 and 13. When I invoke the requests from usual java program it
>> takes less than a second per request - this is normal since routines at
>> this phase are void , they just return values.
>>
>> Again, these delays are unacceptable for out application and if not
>> resolved we will abandon JacORB and move to another ORB or perhaps Web
>> service technology.
>>
>> Can someone from JacORB developers or mailing list contributors pay some
>> attention and help resolving this issue, in order to continue with my
>> project and use JacORB.
>>
>> Kujtim Hyseni
>>
>> _______________________________________________
>> jacorb-developer maillist  -
>> jacorb-developer at lists.spline.inf.fu-berlin.de
>> https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer
>>
>
>



More information about the jacorb-developer mailing list