Skip to content

Random memory leak when typing Chinese comments in my sketch #144

Open
@Ebola-Chan-bot

Description

@Ebola-Chan-bot

Describe the problem

When I type Chinese comments in my sketch, severe memory leak occurs randomly in the arduino-language-server process.
image

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:

  1. Open my sketch with Arduino IDE v2.0.3, and switch to IStepTrial.h
  2. Open Task Manager and monitor the memory footprint of arduino-language-server.
  3. 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.
    image

Gbec.zip

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions