# Increase Communication Buffer Size

If the [kHyperDbg](https://docs.hyperdbg.org/using-hyperdbg/prerequisites/signatures#kernel-debugging-debugger-mode) communication displays an error message stating that your script or buffer is too large to be saved in the default communication buffer, this means that the buffer size has exceeded the maximum size that can be sent to the debuggee (e.g., "`err, buffer is above the maximum buffer size that can be sent to debuggee (93080 > 40960)`").

HyperDbg initially allocates several pages for sending and receiving communication buffers. If the buffer size surpasses the maximum size, then the above-mentioned error message will be displayed.

To fix this problem, you must build a customized version of HyperDbg that uses the most suitable size for your requirements.

Navigate to the source code and locate the **SDK** and Headers folders. In the header files, search for `MaxSerialPacketSize` and you will see the following code:

```clike
/**
 * @brief size of buffer for serial
 * @details the maximum packet size for sending over serial
 *
 */
#define MaxSerialPacketSize 10 * NORMAL_PAGE_SIZE
```

The above macro defines the default buffer size. You must increase it according to your buffer size estimation provided in the error message.

After that, [rebuild](https://docs.hyperdbg.org/getting-started/build-and-install) HyperDbg, and use your custom-made version of the debugger.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperdbg.org/tips-and-tricks/misc/customize-build/increase-communication-buffer-size.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
