Note that there are some explanatory texts on larger screens.

plurals
  1. PONetty Server Push Usage and Memory Leak
    primarykey
    data
    text
    <p>I'm now using Android as my Netty client. And Windows as my Netty Server. Recently, I find a strange behavior on Netty. When I open the server-side app, the memory is only 30MB. But after several hours, it rises up to 300M. Its 10x compared to the original memory usage. The longer I open the server, the more memory it will increase.</p> <p>I don't know why this is happening. Is it normal?</p> <p>By the way, since Netty doesn't support built-in server push feature. So I use a static method to store all of the Channel in the map:</p> <pre><code>public static final Map&lt;Integer, Channel&gt; mapConcurrentIdChannel = new ConcurrentHashMap&lt;Integer, Channel&gt;(); </code></pre> <p>I map the channel ID to Channel. For example: Whenever client A wants to push message to client B, the server will find the channel id and thus get the Channel instance, then use Channel.write(object) method. Is this a correct method to implement Push Message feature in Netty? (If not, could you please suggest a good method to implement Push feature? Since there's no official docs mention that) Also, I'm afraid this implementation causes "Memory Leak Problem" which I explain earlier.</p> <p><strong>About using ChannelGroup:</strong><br /> My scenario is if there are 5 people, A, B, C, D, E. Sometimes, A wants to send message to C, and sometimes B wants to send message to E. I can't predict when somebody will send message to somebody and who they will send to. So I can't add all the 5 people(connection) to the ChannelGroup, which writing to that group would broadcast the message to everyone.</p> <p>I've searched on Google for a long time and nothing help on my problem I'm now facing. Wish to hear some recommendations from Netty experienced developers, you!!</p> <p>Thanks!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload