❔ Need help with giant amount of data stored in clipboard
I am trying to keep a history of the user's clipboard locally, but if I load into memory a giant clipboard text (like 40MB+) some exceptions come up and stuff. How should I manage such big amounts of data and also keep ram usage as low as possible?
6 Replies
What kind of exceptions
If the data is exceedingly large, why not save it somewhere?
Or compress it?
do you often copy text files 40 000 000 characters long?
or do you mean you're putting the history into a single file?
well then you can just split them into multiple files
but 40 mb isn't even much
"some exceptions come up and stuff" is not enough to diagnoze your problem
safe file handles might be useful in your use case
no, but the thing is i don't copy files
i copy the text straight up
the exception was
openclipboard failed (0x800401d0 (clipbrd_e_cant_open))
(it doesn't come up in the video)
now it seems like it works a better (as the process doesn't crash)
also not sure how good my approach is :))
I am still pretty new to C#
So, any suggestions on how to handle larger clipboard texts?
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.