❔ Why is the order of execution wrong?
I have this code inside an async clipboard changes listener
But the output in the debug console is the following
Note that
doesn't come out at the end if there's something in ClipboardData for some reason
What am I doing wrong?
14 Replies
what's 67108864?
did u try debugging with the debugger?
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
i assume u called this method twice
around 64mb in text irc
no, will try using it, thanks for the suggestion
so what?
TheRanger#3357
REPL Result: Success
Result: int
Compile: 310.866ms | Execution: 59.733ms | React with ❌ to remove this embed.
i am ignoring texts that are bigger than 64mb atm
i know that it could be like 256mb with the same lenght but 🥱
Well then make that a constant that says
ignoredTextLengthThreshold
Also, why are you calling the GC there?because for big texts even if i don't use them, the ram gets used up for no reason
also, it's 2x that, strings are UTF-16
chars are two bytes long
Just so you know, running the gc does not remove your strings from the dictionary, and it's not even guaranteed to remove the text variable from memory
And even if it would, don't call the gc manually
It will run on its own when your program needs memory
Idk, maybe you have a good reason to do what you did
But if you did it just because, then don't do it
ik they don't get removed from the dictionary and ik that gc is something that I shouldn't mess with, I will make a video of the ram usage so y understand why i did that
probably and 100% there is a better way for the useless ram usage issue, but i will look into that more after i resolve my execution order thingy
Running the GC is a very costly operation
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.