While working on a new version of my iTunes Playlists to Xml application, I've been playing around with the existing code, for consolidation and speed.
While looking at memory usage, I played around with the StringBuilder I'm using to create the Xml output. As part of this I tried using Remove, once I had output the Xml, but experienced a large increase in used memory, after doing this.
StringBuilder someSB = new StringBuilder(); someSB.Append("Some data" + System.Environment.NewLine); someSB.Append("Some more data" + System.Environment.NewLine); // Trimmed textBox.Text = someSB.ToString(); someSB.Remove(0, someSB.Length - 1);
This jumped memory usage, on a pull using the defaults, against a 6460 item playlist, from ~17,000 to ~21,000 K, on my up-to-date Windows Vista Ultimate machine. Keeping the Remove() off, or just setting the StringBuilder to null, resulted in no jump of memory usage.
In the past I've used System.Text.StringBuilder.Remove(), thinking it would decrease memory usage faster, but it seems that's not the case.
I don't care all that much to discover why, at the moment, but if I decide to look about, I'll update this post or add a comment.
- Review: Logitech G903 LIGHTSPEED Gaming Mouse with POWERPLAY Wireless Charging Compatibility
- Review: Empires of EVE: A History of the Great Wars of EVE Online
- Review: Ghost in the Shell README: 1995-2017
- Review: Fitbit Charge 2 Bands,Fitbit Bands Milanese Loop Stainless Steel Metal Replacement Bracelet Strap, Wristbands Accessories for Charge 2 with Stronger Magnetic Clasp
- Review: Wickedly Prime Organic Roasted Seaweed Snacks, Korean Kalbi
Support This Site
If my blog was helpful to you, then please consider visiting my Amazon Wishlist.