So I have a “memory leak” (not strictly accurate, yes, but it’s similar in practice, so I don’t know what to call it - memory bloat, maybe). I let it run overnight and then parse out the garbage collection messages into an excel spreadsheet. Over the course of 12 hours, both my String and Value type memory usage are increasing at exactly the same rate - there is a difference of 14KB between them when I powered on the machine yesterday, and 14KB when I came in this morning, however, the values had increased dramatically.
Type 11 (STRING ): 358240 bytes
Type 14 (VALUETYPE ): 341424 bytes
Type 11 (STRING ): 1063120 bytes
Type 14 (VALUETYPE ): 1048800 bytes
They appear to be increasing roughly linearly, and my array types aren’t increasing in size so it’s not an arraylist or hashset that is growing in size without my knowledge. I also force GC when memory hits a certain point because I’ve had issues with Out of Memory exceptions in the past crashing my program, and I force it to wait for finalizers. This also has cropped up as I have been moving to the UI library, so I may be doing something wrong with the UI and breaking it.
As far as I understand it, a string is a value type, but it is more than the valuetype designation - wouldn’t valuetype include things like ints, doubles, structs, etc. and should be larger? They’re clearly related, otherwise they wouldn’t increase at an identical rate, but I’m just trying to figure out what’s going on under the hood so I know where to start looking.
Ultimately, my question is this - What is VALUETYPE? the valuetypes are broken out into their own categories, so if VALUETYPE is something specific I can narrow it down.