Initially I also thought that the problem lies in the garbage collector 
(your assumption is correct, I am using JVM), or memory leakage. However, I 
have been monitoring the application's memory and thread profiles (using 
JConsole), but found no irregularities.

I also agree with you that there is apparently no reason for which a piece 
of code will become slow over time. Especially when the other parameters 
are remaining the same. By other parameters, I am referring to the network 
and the request packet size (its around 250 KB).


On Friday, January 11, 2013 1:15:06 PM UTC+5:30, Henner Zeller wrote:
>
> On 10 January 2013 23:30,  <[email protected] <javascript:>> wrote: 
> > Because, to process the request object (in #7), the methods which are 
> > present in the google protobuf generated file are called. The protobuf 
> > request object contains multiple requests, and the time taken to extract 
> > these (requests) is gradually increasing with time. 
>
> If you think about it, it is pretty unlikely that the generated code 
> will get 'slower' over time. 
> Typically, I have seen JVMs slow down because they get busy with 
> garbage collecting. So this kind of behavior might be related to 
> memory allocation in the system and subsequently slower garbage 
> collection (from your description it sounds like  you're using Java). 
> Garbage collection that kicks in in the middle of processing will make 
> things slower. If you see such huge degradation of performance, then 
> doing a memory profiling will bring you do some good insight what is 
> happening. The JVM has some built-in diagnosis as well that you can 
> use initially (such as percentage of time it spends garbage 
> collecting). 
>
> Of course, it could be as something else, like increasing size of the 
> data you parse with the protocol buffers ? Or maybe somewhere in the 
> IO sub-system a buffer is not cleared and you parse a  huge chunk of 
> byte-array ? You could probably see that by adding a debugging log 
> that shows you the byte-buffer size before you call parseFrom(). 
>
> Hope this helps, 
>  -h 
>
> > I think this is protobuf problem because these classes where generated 
> by 
> > the protobuf compiler (from the .proto file). 
> > 
> > 
> > On Friday, January 11, 2013 12:41:35 PM UTC+5:30, Feng Xiao wrote: 
> >> 
> >> What makes you think it's protobuf's problem? 
> >> 
> >> On Friday, January 11, 2013 2:50:54 PM UTC+8, [email protected]: 
> >>> 
> >>> My application uses Google Protocol Buffer with Apache MINA. There are 
> >>> clients who connect to the MINA Connector, send request to the server 
> and 
> >>> then wait for the response from the server. The flow of control is as 
> >>> follows: 
> >>> 1. Client sends request 
> >>>     2. Request received at MINA filter (<Class> extends 
> >>> CumulativeProtocolDecoder) 
> >>>         3. doDecode() method is called 
> >>>             4. A request object (generated from *.proto file) is 
> created 
> >>> using the <RequestObject>.parseFrom(bytes) 
> >>>                 5. The request is passed on to the IOHandler (<Class> 
> >>> extends IoHandlerAdapter) 
> >>>                     6. messageReceived() method is called 
> >>>                         7. In this method, the request object (from 
> #6) 
> >>> is processed to create the list of requests which has been sent by the 
> >>> client. 
> >>>                         8. At this point, we have noticed that the 
> time 
> >>> taken to process the request object (#7) is gradually degrading with 
> time. 
> >>> From a initial period of around 2 ms, the time period is going up to 
> 200 ms 
> >>> in just 8 days of continuous usage. And this value gradually increases 
> with 
> >>> time. 
> >>>                             9. The request list is processed in the 
> >>> application 
> >>>                           10. The response object is created 
> >>>                       11. The response is sent to the client. 
> >>> 
> >>> Any suggestion would be highly appreciated. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Protocol Buffers" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/protobuf/-/IRKxKX0EKRUJ. 
> > 
> > To post to this group, send email to [email protected]<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:>. 
> > For more options, visit this group at 
> > http://groups.google.com/group/protobuf?hl=en. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/MpM80-uir7IJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to