Open
Description
Describe the problem
When I type Chinese comments in my sketch, severe memory leak occurs randomly in the arduino-language-server process.
To reproduce
Since the issue occurs randomly, there are no steps to 100% reproduce. But after some fumbling, I found a way to reproduce with the greatest probability:
- Open my sketch with Arduino IDE v2.0.3, and switch to IStepTrial.h
- Open Task Manager and monitor the memory footprint of arduino-language-server.
- Use the Microsoft Pinyin input method to type the comment text on line 16 as it is on line 17. Note that keyboard input is required, not copy-paste. You will most likely observe a memory explosion before you finish this line.
I have tried some of other sketches and they were all less likely to trigger this issue than my sketch. I offer my sketch here so that you may easily reproduce the issue.
Expected behavior
The Arduino code language may not have plans to support Chinese, but I don't think there should be a serious problem like a memory leak just because of a few lines of Chinese comments anyway.
Arduino Language Server version
0.7.2
Arduino CLI version
0.29.0
Operating system
Windows
Operating system version
Win11 22H2, Win10
Additional context
No response
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest version
- My report contains all necessary details