﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Sorry, what I meant, is that they aren't short lived, they are put into a processing queue and it may be quite a while until they are processed and some of them discarded
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment14</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment14</guid><pubDate>Mon, 28 Dec 2009 12:07:14 GMT</pubDate></item><item><title>Ayende Rahien commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Patrick,
  
They _aren't_ short lived, they go, almost always as-is, to live as part of the in memory model
  
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment13</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment13</guid><pubDate>Mon, 28 Dec 2009 12:06:00 GMT</pubDate></item><item><title>Patrick Smacchia commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>I am surprised that your program overwhelm the GC by allocating short-living strings. Certainly the GC team would be interested by your experience. 
  
  
I am not sure to understand, what is the content of your strings, code element names? profiler events descripion?
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment12</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment12</guid><pubDate>Mon, 28 Dec 2009 11:46:28 GMT</pubDate></item><item><title>Ayende Rahien commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Patrick,
  
I am speaking out of experience here, I just finished doing MAJOR perf session on the profiler.
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment11</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment11</guid><pubDate>Mon, 28 Dec 2009 11:30:40 GMT</pubDate></item><item><title>Patrick Smacchia commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Are you sure that you can overwhel the GC this way? Internally the GC has its own heap for string and is extremely optimized to allocate/deallocate many strings. When it comes to performance and GC, common sense and suppositions are of poor help. Code it, measure it, and see where is the bottleneck, if any. Many times I had good surprises. And when I had bad surpirses, they never came from where I expected.
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment10</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment10</guid><pubDate>Mon, 28 Dec 2009 07:56:13 GMT</pubDate></item><item><title>Ayende Rahien commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Patrick,
  
You are correct, in a sense.
  
The problem is that uncompressing a string will require me to allocate more memory, which leads to the GC having to do more work in the end. 
  
My main worry isn't CPU time, it is memory, and having to keep allocating new strings (by the millions, btw) leads to a lod of garbage that the GC have to clean up.
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment9</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment9</guid><pubDate>Mon, 28 Dec 2009 05:00:20 GMT</pubDate></item><item><title>Patrick Smacchia commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>The problem is to keep many string values alive (i.e not collectable by GC) in memory, so you need a way to compress/uncompress strings values (with a set of words or UTF8 or anything else). 
  
  
String interning is not really compression in the sense that you keep the whole strings values in memory. Strings interning just avoid duplication of same values. Moreover, string interning is not computation free, computing hash code on strings + dico search is not free and even, proposed string hash code impl in .NET Fx are far from being optimal in terms of performance.
  
  
I think you need something more tricky than string interning to save some memory.
  
  
&gt;As for UTF8, it doesn't work if you need to translate to standard strings all the time
  
  
I don't get you, once you need a string value, just uncompress it, use it, and immediately release the reference?!
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment8</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment8</guid><pubDate>Sun, 27 Dec 2009 21:55:07 GMT</pubDate></item><item><title>Ayende Rahien commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Patick,
  
That is more or less what I meant by interning strings.
  
As for UTF8, it doesn't work if you need to translate to standard strings all the time, you would allocate a lot of mem just that way
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment7</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment7</guid><pubDate>Sun, 27 Dec 2009 20:15:38 GMT</pubDate></item><item><title>Patrick Smacchia commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Just an idea that would take a bit of CPU cycles but can drastically reduce memory. In a code base, just a relatively small set of word is used in code elements identifiers. (Do, Go, String, Session, Event, On, Profile, Handler, get_, (, ), User...). You can harness that fact to your advantage by building a set of these words on the fly and a string identifier becomes an array of ids of these words.
  
  
Another idea: store strings using UTF8, since 99% of char in identifiers are in the first 128 ASCII chars (and take only one byte footprint instead of two).
  
  
Recently I applied several others tricky-like algo in NDepend with incredible performance/mem consumption improvements. What I discovered in 2009 is that using very tricky ideas, I never heard about in 15 years of programming, pays off. The result is to be released in a few weeks, I cannot wait :o)
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment6</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment6</guid><pubDate>Sun, 27 Dec 2009 19:49:42 GMT</pubDate></item><item><title>Jeff Brown commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Now wondering whether the next series of posts will feature disk based index shards and external sorting...
  
  
Or perhaps it will be about creating summaries...
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment5</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment5</guid><pubDate>Sun, 27 Dec 2009 06:14:40 GMT</pubDate></item><item><title>FallenGameR commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>When OS runs out of memory it swaps.
  
  
Either you make some sort of clustering (main string + differences) or you swap memory to disk.
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment4</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment4</guid><pubDate>Sat, 26 Dec 2009 19:57:32 GMT</pubDate></item><item><title>Cengiz Han commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>You can provide an option for your tools like "use mmf" and if users encounter with OOME exceptions can try to work in mmf mode.
  
  
[http://mmf.codeplex.com/](http://mmf.codeplex.com/) you can check this project (memory mapped files)
  
and also .net 4.0 has system.io. memorymappedfiles namespace for this kind of job.
  
  
btw. luckly, I didn't need to use this projects for now.
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment3</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment3</guid><pubDate>Sat, 26 Dec 2009 12:47:20 GMT</pubDate></item><item><title>Michal Chaniewski commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Maybe memory-mapped files?
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment2</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment2</guid><pubDate>Sat, 26 Dec 2009 12:18:01 GMT</pubDate></item><item><title>Szymon Kulec commented on The operation was successful, but the patient is still dead&amp;hellip; deferring the obvious doesn&amp;rsquo;t work</title><description>Hi Ayende,
  
will you end up with a db for your profiler?
</description><link>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment1</link><guid>http://ayende.com/4340/the-operation-was-successful-but-the-patient-is-still-dead-deferring-the-obvious-doesn-t-work#comment1</guid><pubDate>Sat, 26 Dec 2009 11:55:34 GMT</pubDate></item></channel></rss>