unormal,
@unormal@mastodon.social avatar

ITS FUCKING STRINGBUILDERS running this code over and over again explodes "untracked"

image/png

xgranade,
@xgranade@wandering.shop avatar

@unormal Does it help to specify the initial capacity of the StringBuilder? E.g.: new StringBuilder(1000)?

onelson,
@onelson@mastodon.social avatar

@unormal real quick, could the memtest.Add call be keeping the sb alive past when it would normally GC? Would be weird if the memory profiler causes leaks like that, but idk this is weird full stop.

unormal,
@unormal@mastodon.social avatar

@onelson sure, it's trying to keep it alive, it shouldn't be "untracked" though, it's normal-ass managed memory

onelson,
@onelson@mastodon.social avatar

@unormal okay. I just figured the string builder might do weird shit internally for perf, but still know how to clean up when the last ref is removed.

unormal,
@unormal@mastodon.social avatar

@onelson yeah it's possible it's got an optimized path and the memory profiler has a bug/just can't see it. It's a good guess but who knows

unormal,
@unormal@mastodon.social avatar

jesus christ lol

unormal,
@unormal@mastodon.social avatar

(memory use should correctly be exploding, but it should be tracked memory use, as stringbuilders are [???] managed [???])

mcc,
@mcc@mastodon.social avatar

@unormal wait wait hold on

I think I know what's happening, do you want advice or are you just venting

mcc,
@mcc@mastodon.social avatar

@unormal …although looking at your sample code closely uh… wow wtf

unormal,
@unormal@mastodon.social avatar

@mcc it reproduces in a naked project with JUST the stringbuilder loop

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • InstantRegret
  • Durango
  • provamag3
  • everett
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • megavids
  • anitta
  • tester
  • JUstTest
  • lostlight
  • All magazines