Putting giant text into Script takes up too much memory

When I try to copy paste 24 Megabytes of text from Notepad into the Script editor, my RAM usage goes up by 4 GB, and it never goes down. Why is it like this? I am only pasting 24 Megabytes, so why does this Script take up 4 GB of memory? I am not sure if I should post this as a bug or not, as it might be intended, but I don’t know why.

Did you copy in code or string? Maybe its the syntax highlighting that’s causing the issue.

I don’t think it’s the syntax highlighting as the high memory doesn’t change when I close the Script, as afaik the syntax highlighting only happens when the Script is opened.