The OnMessage and Send methods in InputReceiver are used to send and receive messages


8937831--1225794--Snipaste_2023-04-07_19-28-15.png
As shown in the figure above, the channel of inputReceiver is used to send and receive messages between web terminal and Unity terminal. However, at present, each data transmission will cause memory increase. Have you ever encountered similar problems


When Unity receives web data through OnMessage in the InputReceiver script, it will cause the Reserved memory of Managed Heap to increase

Could you tell us about your environment? (OS, Runtime or Editor, Editor version etc…)
We will investigate.

OS is Windows,This problem is present both in the bundled Windows project and in the editor, editor version : 2021.3.8f1

Unity RenderStreaming 3.1.0-exp.5

The problem has been fixed, there was a problem with the data format of the Web push, and the memory problem disappeared when I combined bytes[0] to distinguish mouse, keyboard, and custom messages

1 Like