# AMF3Utils.deserializeInt: java.nio.BufferUnderflowException

**URL:** <https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055>\
**Category:** Wowza Streaming Engine\
**Created:** [March 24, 2010, 8:08pm UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055 "2010-03-24T20:08:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Senthilrajan\_Egaraja](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Senthilrajan\_Egaraja](https://community.wowza.com/u/Senthilrajan_Egaraja)\
**Post date:** [March 24, 2010, 8:08pm UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/1 "2010-03-24T20:08:25Z")

</div>

Hi,

I encountered the error sporadically on Wowza server. I noticed this error keeps repeating till I restart the server and blocks other clients trying to connect . Are there any specific cases when this will occur?

> ERROR server comment 2010-03-22 19:32:36 - - - - - 378447.058 - - - - - - - AMF3Utils.deserializeInt: java.nio.BufferUnderflowException
> 
> ERROR server comment 2010-03-22 19:32:36 - - - - - 378447.058 - - - - - - - constructor AMFDataObj(ByteBuffer): java.nio.BufferUnderflowException
> 
> ERROR server comment 2010-03-22 19:32:36 - - - - - 378447.058 - - - - - - - position: 159
> 
> ERROR server comment 2010-03-22 19:32:36 - - - - - 378447.058 - - - - - - - limit: 159
> 
> ERROR server comment 2010-03-22 19:32:36 - - - - - 378447.058 - - - - - - - data
> 
> 11 0a 0b 01 07 73 69 64 05 40 3a 00 00 00 00 00 …sid .@:…
> 
> 00 15 61 63 74 69 6f 6e 54 79 70 65 05 40 08 00 …action Type.@…
> 
> 00 00 00 00 00 11 63 72 65 61 74 65 54 43 06 0d …cr eateTC…
> 
> 35 31 35 37 35 30 03 70 05 40 00 00 00 00 00 00 515750.p .@…
> 
> 00 17 69 6e 69 74 69 61 6c 44 61 74 61 0a 0b 01 …initia lData…
> 
> 00 05 40 3a 00 00 00 00 00 00 05 74 70 05 40 26 …@:… …tp.@&
> 
> 00 00 00 00 00 00 03 78 05 40 78 e0 00 00 00 00 …x .@x?..
> 
> 00 03 79 05 40 69 c0 00 00 00 00 00 05 77 69 05 …y.@i?. …wi.
> 
> 00 00 00 00 00 00 00 00 05 68 69 05 00 00 00 00 … .hi…
> 
> 00 00 00 00 05 73 6e 06 05 74 63 06 06 01 01 …sn. .tc…

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 24, 2010, 2:56pm UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/2 "2010-03-24T14:56:30Z")

</div>

This can happen if the server is not tuned properly. Follow the tuning guide:

[https://www.wowza.com/docs/how-to-do-performance-tuning](https://www.wowza.com/docs/how-to-do-performance-tuning)

Richard

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [March 25, 2010, 3:55am UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/3 "2010-03-25T03:55:22Z")

</div>

What volume of streams are you testing? **Xmx768M** is not a lot of memory.

Charlie

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [March 25, 2010, 5:01am UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/4 "2010-03-25T05:01:49Z")

</div>

The error happens because of long GC pauses that cause transmission problems. So the error is due to the TCP connection becoming out of sync. Crank up the heap size. 768M is way, way, way to low for 600Mbps of transmission. Go with 64-bit OS and VM and move to 3000-4000M heap.

Charlie

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [May 13, 2010, 3:00pm UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/5 "2010-05-13T15:00:10Z")

</div>

It sounds like the so is corrupt. That is the most likely explenation.

Charlie

---

<div class="post-metadata">

**Author:** ![Senthilrajan\_Egaraja](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Senthilrajan\_Egaraja](https://community.wowza.com/u/Senthilrajan_Egaraja)\
**Post date:** [March 25, 2010, 5:07pm UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/6 "2010-03-25T17:07:36Z")

</div>

Hi,

Thank you for the reply.

I checked configuration flow, and i tryed to repro the same issue using these setting changes. I got only OutOfMemoryError.

> ERROR server comment 2010-03-25 06:05:47 - - - 455.784 invoke(onAppStart): java.lang.OutOfMemoryError: Java heap space: java.lang.StringCoding$StringEncoder.encode(StringCoding.java:232) - - - - - - - - - - - -

**My current settings**

[install-dir]/bin/setenv.bat (Windows)

```auto
set JAVA_OPTS=-Xmx768M

```

[install-dir]/bin/WowzaMediaServer-Service.conf (Windows)

```auto
wrapper.java.additional.1=-Dcom.wowza.wms.AppHome="%WMSAPP_HOME%"

```

[install-dir]/conf/VHost.xml

```auto
<ReceiveBufferSize>65000</ReceiveBufferSize>
<SendBufferSize>24000</SendBufferSize>

```

If i made any misstake on code, please give the solution

---

<div class="post-metadata">

**Author:** ![Senthilrajan\_Egaraja](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Senthilrajan\_Egaraja](https://community.wowza.com/u/Senthilrajan_Egaraja)\
**Post date:** [March 25, 2010, 6:12pm UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/7 "2010-03-25T18:12:59Z")

</div>

The wowza server would be handling close to 600Mb of data (max) for an hour. Our earlier heap size was 768M.

But we noticed the error in the first post sporadically and based on the suggestion made for that post, we tried to bring down the heap size and buffer size, to reproduce the issue, but were not successful.

Can you let us know more specifically when the BufferUnderFlowException under the **deserializeInt** code would occur?

---

<div class="post-metadata">

**Author:** ![Senthilrajan\_Egaraja](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Senthilrajan\_Egaraja](https://community.wowza.com/u/Senthilrajan_Egaraja)\
**Post date:** [May 14, 2010, 4:26am UTC](https://community.wowza.com/t/amf3utils-deserializeint-java-nio-bufferunderflowexception/34055/8 "2010-05-14T04:26:46Z")

</div>

We recently noticed, that we get the above mentioned error, when reading some particular slots from an RSO. It happens when we do a sharedObjects.load() on the rso directory where this RSO resides.

Any pointers on when we would notice such an error when reading data from an RSO?

Thanks in advance,
