What was I doing? No, I wasn't linking the source code to the universe; I was merely compiling a file in the Spec 2006 benchmarks. And this wasn't anything large--only 3700 lines of code or so in a single C++ file. And the pass that wasn't dying wasn't some horribly written pass that leaked memory like a leaky bucket. Indeed, LLVM tends to get you to free memory too quickly, judging by how many times I've chased down memory corruption. If you don't believe me, the offending code was this:
Code = CloneBasicBlock(CodeOrig, ValMap, "", F, NULL); for (II = Code->begin(), EE = Code->end(); II != EE; ++II) { if (!isa(II)) RemapInstruction(II, ValMap, RF_IgnoreMissingEntries); }
For those of you who don't know what the code is doing, it roughly amounts to this: make a copy of a basic block of a function, and then tell all of the instructions to use the new instructions instead. On some programs, though, this simple instruction seems to have compelled the code to eat up gigabytes of memory.
Fortunately, I am now proud to announce that I have reduced my memory consumption by 99%… with a one-line fix. So I guess I should get the achievement for "Fix the Memory Leak" as well?
1 comment:
Looking for the best site to watch Tamil movies online free? There are several options available, offering a wide range of classic and new releases for Tamil cinema fans. Popular platforms like MX Player, Zee5, and YouTube provide a selection of Tamil movies at no cost. These sites offer a mix of HD streaming, subtitles, and an easy-to-navigate interface, ensuring a smooth viewing experience. Always choose reliable sites to avoid interruptions and ensure quality streaming. So, if you're eager to dive into Tamil cinema, these sites stand out as some of the best sites to watch Tamil movies online free.
Post a Comment