Results 1 to 6 of 6

Thread: OutMemoryException from the Ice 3.4.1 for java

  1. #1
    cnhome is offline Registered User
    Name: Li Wenzhi
    Organization: FreeLaner
    Project: Train Enquiries for Android
    Join Date
    Apr 2005
    Location
    Beijing, China
    Posts
    64

    OutMemoryException from the Ice 3.4.1 for java

    I use a work thread by 'amd' in server-side, the error as following. How can I do for this?!

    -- 11-5-8 21:15:49:550 Server: Network: received 14 of 14 bytes via tcp
    local address = 127.0.0.1:10002
    remote address = 127.0.0.1:50758
    -- 11-5-8 21:15:49:565 Server: Network: received 71 of 71 bytes via tcp
    local address = 127.0.0.1:10002
    remote address = 127.0.0.1:50758
    -- 11-5-8 21:15:49:565 Server: Protocol: received request
    message type = 0 (request)
    compression status = 0 (not compressed; do not compress response, if any)
    message size = 85
    request id = 5
    identity = Search
    facet =
    operation = singalSearch
    mode = 0 (normal)
    context =
    -! 11-5-8 21:15:49:565 Server: warning: Thread-12: dispatch exception:
    identity: Search
    facet:
    operation: singalSearch
    Ice.MarshalException
    reason = "OutOfMemoryError occurred while allocating a ByteBuffer"
    at IceInternal.Buffer.reserve(Buffer.java:164)
    at IceInternal.Buffer.(Buffer.java:73)
    at IceInternal.Buffer.expand(Buffer.java:60)
    at IceInternal.BasicStream.expand(BasicStream.java:20 67)
    at IceInternal.BasicStream.writeBlob(BasicStream.java :615)
    at Engine.METAHelper.write(METAHelper.java:34)
    at Engine.ResultNode.__write(ResultNode.java:119)
    at Engine._AMD_SearchTile_singalSearch.ice_response(_ AMD_SearchTile_singalSearch.java:39)
    at WorkThread.run(WorkThread.java:29)
    Caused by: java.lang.OutOfMemoryError: Direct buffer memory
    at java.nio.Bits.reserveMemory(Unknown Source)
    at java.nio.DirectByteBuffer.<init>(Unknown Source)
    at java.nio.ByteBuffer.allocateDirect(Unknown Source)
    at IceInternal.Buffer.reserve(Buffer.java:138)
    ... 8 more

  2. #2
    cnhome is offline Registered User
    Name: Li Wenzhi
    Organization: FreeLaner
    Project: Train Enquiries for Android
    Join Date
    Apr 2005
    Location
    Beijing, China
    Posts
    64
    I set the property 'Ice.GC.Interval=30'. But I can't find any collector thread!

    Ice_error.gif

  3. #3
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Ice.GC.Interval is actually only for C++ ... we'll make this clearer in the Properties reference.

    In other programming languages (like Java), Ice does not implement its own GC.

    It's hard to say why your server is running out of memory. Perhaps your server accumulates AMD callbacks but never provide the response and release them?

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  4. #4
    cnhome is offline Registered User
    Name: Li Wenzhi
    Organization: FreeLaner
    Project: Train Enquiries for Android
    Join Date
    Apr 2005
    Location
    Beijing, China
    Posts
    64
    Bernard,

    My demo don't use any business process that just start a thread read from queue and response the request. I really can't find any wrong. Can you give me some sample codes about the Java 'AMD'. Thanks very much!

  5. #5
    cnhome is offline Registered User
    Name: Li Wenzhi
    Organization: FreeLaner
    Project: Train Enquiries for Android
    Join Date
    Apr 2005
    Location
    Beijing, China
    Posts
    64

    Red face

    Oh, my god! I find the reason: My 'LinkedTransferQueue' call ice_response and not release the callback interface. So I set the callback to null. Everything is OK!

    Thanks bernard!

    Ice is very beautiful thing! Like this! Hope Ice go on!

    I want 'BuildingSeq.ice' can surpport offset and length for the array data.

  6. #6
    cnhome is offline Registered User
    Name: Li Wenzhi
    Organization: FreeLaner
    Project: Train Enquiries for Android
    Join Date
    Apr 2005
    Location
    Beijing, China
    Posts
    64

    Red face

    some topics are very useful:

    Help! Why ice_response for AMD block?

    Help! Why ice_response for AMD block?

    what will happen when ice report thread pool size warning?

    TimeoutException throws at Outgoing.cpp:183

    If you never call ice_response or ice_exception, your client will never receive any response or exception, and your server will continue to grow in size (i.e., this is a memory/resource leak).

    If there is a timeout configured for the client, your requests will eventually time out, and the whole connection is closed (since timeouts are treated as fatal connection errors, see our user manual for details).

    Note that such client timeouts would not resolve any resource leaks in the server caused by incomplete AMD calls. You must make sure that your code calls either ice_response or ice_exception for every AMD call, otherwise your program will leak.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Is the ICE for Java based on Java NIO?
    By Jiangyubao in forum Comments
    Replies: 1
    Last Post: 03-30-2008, 06:04 PM
  2. 1 Java Server and 2 Java Clients
    By maalej in forum Help Center
    Replies: 1
    Last Post: 10-06-2007, 05:08 PM
  3. java:type:java.util.Vector
    By jesse in forum Help Center
    Replies: 1
    Last Post: 04-23-2007, 12:49 PM
  4. Replies: 2
    Last Post: 11-24-2006, 03:03 AM
  5. Replies: 1
    Last Post: 09-16-2005, 03:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •