question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Max buffer size not exceeding 262144 (Buffer overflow exception)

See original GitHub issue

Hi all,

I have been using the library in one of my projects where a large number of akka messages are being sent around. This culminates in a large aggregate message being generated which causes a com.esotericsoftware.kryo.KryoException: Buffer overflow exception to be thrown. In response to this I have increased the buffer-size and max-buffer-size multiple times (even to max_int), but to no avail. The maximum size of this data is ~40MB, which is obviously a lot smaller than this 2GB buffer.

image

I have been debugging this for the last couple of hour, following the error through to the ByteBufferOutput class, and it appears that the maxCapacity never exceeds 262144 (as can be seen in the screenshot above). I can’t seem to find anywhere that I could change/set this number. It also appears that the ByteBufferOutput constructor where the maxCapacity isn’t passed through (line 66) is the one being called, which could be the cause of all of this.

I am using your latest version (“io.altoo” %% “akka-kryo-serialization” % “2.2.0”)/akka version 2.6.14, and other than registering my classes/changing the buffer size, all the settings are as in reference conf. This can be seen here if of any assistance.

It’s very much possible I am being an idiot and missed something, so if you can point me in the right direction that would be fantastic. If not and this is an issue I am more than happy to provide a more detailed run down of reproducing the problem and to help engineer a solution.

All the best, Ben

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
danischroetercommented, Jul 27, 2021

@miratepuffin Glad you found the issue 👍 and thx for the feedback!

0reactions
miratepuffincommented, Jul 27, 2021

Hi @danischroeter,

Thank you for going through the effort of looking into this. I have found the source of the issue and it was actually a misconfigured maximum-frame-size. I had a good delve through the conf and found that it had changed position in akka 2.6, hence why it was working before and not with my swap into artery/kryo. I apologise for the wasted time, but cheers for the advice and the rubber ducking 😄 best of luck with everything and thanks for making such a fab library.

EDIT: Just a point actually, it may be worth putting a note in the readme or your reference conf that your max-buffer-size cannot exceed akka.remote.artery.advanced.maximum-frame-size and will throw the buffer overflow exception.

All the best, Ben

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exceeded limit on max bytes to buffer webflux error - Stack ...
I suppose this issue is about adding a new spring.codec.max-in-memory-size configuration property in Spring Boot. Add it to the application.yml file like:
Read more >
IT16560: (SFTP) UNABLE TO USE BUFFER LENGTH ... - IBM
User attempting to increase the buffer size from the client sid using the -B option. The client connection is immediately.
Read more >
MySQL Bugs: #103225: "Out of sort memory error" has an ...
The reason is that there is lots of wrong information about the sort buffer size (even prompting Baron Schwartz to discourage changing it...
Read more >
BufferOverflowException with Large Files - support for CloverDX
This error message is given by the fact, HTTPConnector actually stores the response in memory and if you do not have sufficiently sized...
Read more >
Debugging a Stack Overflow - Windows drivers | Microsoft Learn
This shows that the maximum stack size is 256 K, which means more than adequate stack space is left. Furthermore, this process looks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found