- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Your interviewer is an undead zombie and cannot be killed. Also he has no wallet. Now what do you do?
Admin
You would pay a TEAM of people for FIVE months, to do something that could be achieved in <15 minutes and 60 dollars?
Pray you're never put in charge.
Admin
OOM Exception....
The memory is virtual these day's...
So it's leaking or was too big to fit in the virtual memory..
So putting more memory in the server is the WTF (this only prevents swapping, you do not get more virtal memory).
Admin
Oh okay I didnt realise that. So you could ditch BASIC, and just have a big 64k machine code program instead?
I seem to remember that you could write to a particular chunk of memory and this would be writing to the video memory, but reading from there didn't work or something. Is that another BASIC-specific thing?
Admin
Oh this is easy - I'd begin a 5 month optimisation effort.
Admin
I use the company's Amex. Why do you think I'm footing the bill?
Admin
That said, investigating the cheap quick fix is usually preferred, but a quick profile with jProbe and a few standard unix utils can tell you if it's thrashing or leaking like a sieve. The former justifies ram, the latter the rewrite. Having some hard facts to back up your recommendation invariably improves your chances of getting what you need.
As an aside, if you know that the code is a world class wtf, and the manager has to constantly deal with elongated deliverables, even if the ram can solve it today, you can still justify the rewrite.
Admin
A smaller memory footprint is always better due to cache effects.
Intern Bob is inexperienced so we'll forgive him.
Admin
There are only 4 months left before the end of the world. Now what do you do?
Admin
I'm not sure... do you look cute?
Admin
worst article, ever
Admin
So what happens when your web site goes from thousands of hits per day to millions and millions per day? Then all that extra RAM you bought fills up and you are stuck with the server crashing again.
I can think of quite a few bloated apps that you must have been in charge of.
Admin
Admin
The real WTF is that they purchased a production server with only 512mb of ram. A cheap PC from Wal Mart comes with 2 gigs.
Admin
HOOOGAN!!
Admin
Admin
While optimizing code is all well and good, management cares about the bottom line. If the memory usage slowdown ends up being negligible after a cheap RAM upgrade you look pretty stupid for wasting time and money when a quickfix would have kept the trains on time. You say eventually that wouldn't be enough, but then maybe they buy a new server with twice that much ram for 100 bucks. You don't know for sure, and worst case they end up optimizing later but maybe they can get away with it. If the hardware is cheap, then don't blow money optimizing the software first.
I know you all live in Utopias though where it's okay to waste money on non-noticeable improvements, but the intern just pointed out that Wilhelm possibly wasted a lot of money.
Results are all that matters in business.
Admin
One of the main problems here is: if it is a memory leak, you will continue to lose memory (Duh right?). So, by throwing more ram at the machine all you are doing is prolonging the time between server restarts, not preventing them.
Admin
It's not that we're lazy these days. As a developer who works for a living, suppose I have a choice when I choose to implement something: a) An easy, and reasonably fast, solution that I know will work but will require an extra 2 Mb of RAM (maybe temporarily or not). b) A much more complicated, similar speed (possibly slower), algorithm that needs a negligible amount of RAM. c) A very complicated algorithm that is just as fast, maybe faster, and has no significant RAM requirement.
Given that today computing power and RAM are both VERY cheap I'll choose the solution that's the easiest. My time is expensive compared to computing costs. A more complex solution will likely have more bugs in it as well.
The thing to compare is that 20 or 30 years ago, cheap RAM and cheap computing were not available! Different set of criteria placed on developers.
One last point is that whatever you think your product has to scale to may not actually every be. Just because there's the potential for 50 simultaneous million users doesn't mean it's going to happen.
Admin
And here I thought I could be the clever one that makes the first 'Wilhelm scream' reference.
My vote is that the real WTF is that Wilhelm never realized that upgrading hardware was an option.
Admin
From what I read in this article there was no memory leaks, just excessive memory usage. In this case adding memory is by far the best solution - even if the coding standards will have to wait. 512meg is very few for a J2EE app.
That may depend on the project life expectancy, but I think the WTF is what the writer of the article meant it to be.
Admin
No, real programmers started with 4k.
2GB would have increased the time between reboots. While I think a web application should have a good amount of memory for caching purposes, memory leaks and wasted memory usage do need to be fixed.
That, of course, is the difference in opinion between an engineer and a programmer.
Admin
16k!?! I started with 3.5k on a VIC-20, thankyouverymuch.
Admin
TRWTF is that unreleased resources could be file handles, database connections, sockets, you name it. Memory isn't the only thing these 'hasty' programs will leak.
Admin
Sure, I agree that the problem should be fixed rather than swept under the rug. But also keep in mind that devoting that much time and resources to this problem is also "throwing money at the problem" - exponentially greater sums of money.
It's easy for us to sit here and say "why spend $60 for a quick fix when you can get it right for only $<millions>."
Admin
Admin
The article doesn't actually state that the memory leaks were fixed. It does state that the memory footprint was reduced. If the leaks weren't fixed, then the app would still eventually run out of memory, only it would take longer (just as if more memory was added)... unless the app now leaks faster.
Also, there is a thing called Time-Space Trade Off. I'm sure you've heard of it.
In all, it is possible that the app is smaller but a lot slower and leaks memory so much faster that it runs out of memory sooner.
Admin
Sure, that works now, but what will you do after 50 years when you reach the hard limit? Whatcha gonna do then, huh?
You hack! You ad hoc shmuck! The cheapest solution in the long term is to spend $inf to get a system that can have an infinite number of open files.
Admin
In fact IIRC it had 68k of usable RAM because you could store data in the tape/disc I/O buffers. It was a pain to get access to but if you were desparate...
Admin
I was thinking about this also and was surprised that it wasn't getting more notice. Here's my theory:
The fact that the author of the article explicitly brought this issue up leads me to believe that this was a big part of the problem. Holding onto thousands (millions?) of useless objects like this definitely could impact memory usage.
That's my theory, anyway. I've never actually seen anyone do something so stupid before.
Admin
Write-only memory? I really, really hope you're kidding...
Captcha: nobis (seems quite fitting)
Admin
TRWTF is that people actually think this story is a WTF.
Admin
Admin
I'm a velosorapter, what do you do now?
Admin
Was reduced to:
Which should drastically reduce the GC's workload.
I agree with the countless people that state that Wilhelm should focus on fixing memory leaks (and tons of temporary objects), but not focus too much on getting the app below 512MB. You can probably fit a webapp in less than 2KB, but why bother? As with so many thing, it is about finding the balance.
Admin
I think that nobody has bothered to realize that the WTF is that he spent 5 months with 5 people and only got a 50% reduction in memory use (the article doesn't really state that there was a leak)
With 2 developer years of effort I would have hoped for something closer to an order of magnitude!
Admin
Ok, so let me pose a different question to you: What is the end user's time worth to you?
My time is also expensive. If I have to sit and wait for an app because it requires 4 GB of RAM and I have 1 GB, that's wasting MY time. Sure, your time was saved but which time is more valuable? In this case, I'd say it was the end user's time because if your app thrashes and requires a lot of RAM, he's going to want to use the competing product that doesn't. Or he'll go to a competing website.
My computer is also expensive. Hardware is relatively cheap but it's not THAT cheap for the average user. You think the soccer mom who uses your app likes to go out and buy sticks of RAM just because some app is bloated? You think she likes to wait while your server crashes because the app leaks memory?
I don't mean this post as a flame at all, but I think that if more programmers would start caring about the end user's time more than their own time, we'd have a lot more quality apps out there.
Admin
No. But then solving the problem would not have been achieved in <15 minutes and 60 dollars.
Admin
Based on the comments, approximately 2 people think this is a WTF
Admin
Since when is "buy more memory" a more favorable solution to fixing your software so that it is more efficient and has less memory leaks?
People complain about Microsoft Vista and how memory-intensive it is, but you don't hear many people shrugging off the problem by saying "just slap 4 GB in there, and it'll be fine!"
Admin
1k? You were lucky. When I started we only had a 16-bit abacus, and when that broke down we had to go back to scratching marks on clay tablets, outside in the pouring rain, walking uphill both ways and ... oh, nevermind.
Admin
The problem there is that it's almost impossible to measure. I know how to measure my time and what computing requirements cost.
For Joe Sixpack who's unemployed, I can say his time is worth almost $0. For Bill HighflyingCEO, his time might be worth $100/hour.
I don't know about you, but I prefer to take measurements of things I can measure, or reasonably estimate, rather than vague and fuzzy numbers.
Admin
I'm sorry, did you say write-only memory? Whereabouts can you buy that these days?
Admin
Real programmers free memory with a round-kick over the motherboard.
Admin
As funny as this is, it ignores the fact that that original codebase wouldn't scale if traffic increased. There's a limit to how much RAM you can throw in a machine.
Admin
Adding physical memory to solve a virtual memory issue...
Worst article ever, it's only a WTF for non coders.
Admin
Delaying a problem doesn't solve it. And pushing the solution to a point in future only means that you will spend even more money. The program grows and grows and if nobody takes care of the code you will end up with 100,000 lines to correct instead of 50,000. Who saves money in the end? OK, $60 for some 2GB is one thing but its temporary (as usual) and one day the problem will pop up anyway. So better review/rewrite/correct now instead of tomorrow.
Admin
It's pretty easy to measure. There are two ways:
Is your product getting bashed in reviews? Do you know of one person on the planet who actually likes it? Ok, you failed. I'm looking at Vista for the specific example here. The only person I've ever heard of that likes it is Microsoft Fanboy Jeff Atwood. Every other review of it is that it's a bloated piece of crap.
Try using your product on a low end machine. And by low end, I mean something that you might not be able to purchase anymore. Is it incredibly painful? You just measured the cost of your time as it relates to using the app. Not everyone has dual core 2.4 GHz processors and 4 GB of RAM. My machine at home (which I am replacing soon because it's painful) only has 512 MB of RAM.
Another way is to gauge how well your product is selling. MySpace does incredibly well (somehow) despite the fact that it's the most poorly designed web app ever.
There are exceptions but I for one, believe that we need to get back to making applications that are of high quality as opposed to just saying "Eh, in the future 32 TB of RAM will be the norm so who cares!"
Admin
I should also say that I am speaking "ideally". I understand that in the real world, bosses often just want the hack in place to get moving. However, I am of the firm belief that we need to start correcting IT practices now, rather than later and that working extra hours should be the exception, not the norm so I am a little outside of the mainstream :)
Admin
Can't remember.