The article is also (as usual) not kind to Firefox as far as the speed and insane memory consumption it suffers from, which thousands of fanboys have spent the past three years desperately denying for some weird reason.
I won't deny that there is such a problem, but can you explain in detail what the problem is? I go into the MozillaZine forums nearly every day, and although it's not uncommon for someone to complain about a memory or speed problem, no one can seem to give any details of it. How could I see this problem that so many seem to think is so horrible and obvious? Is there a bug report about the problem? Any discussion about the specific of the problem in MozillaZine? Any details at all?
I don't understand the response to this question. I have learned dozens of programming languages, usually ones that have different implementations. When I read them, they do not contain different chapters on different implementations. In C++ books, they discuss C++ and perhaps talk about implementation differences between compilers. For example, they say that an int is a data type that can hold integer values between -32768 and 32767, and can possibly hold larger and smaller values. They may even give examples of some different compilers and their different ranges for ints. But they don't contain completely separate sections on Visual C++ and GNU C++.
Why don't SQL books just explain SQL? Shouldn't I just be able to write SQL code that runs in any DBMS with minimal changes just the way I can write C++ code that compiles with many different compilers and runs on many different OSes with minimal changes? Does it seem like a stupid question? Even so, could someone answer why so many SQL references contain separate sections for different DBMSs, making it difficult to write portable code? Why not just explain SQL and give the differences between different implementations within the same section, instead of covering MySQL, SQL Server, etc. as if they're separate languages?
The main problem with that is that even if SQL was 100% standard, databases still have different behavior. For example, if you tune something for MS SQL Server, performance will suck on postgres and viceversa. If you try to make it run well on both, it'll run suboptimally on both.
Still, it would be easier to switch from SQL Server to Postgres if I stuck with features available in both. And it would be easier to do that if the documentation listed features that were widely available, and mentioned if any of those features were not implemented in Postgres. If I have documentation specific to SQL Server only, how do I know which features will or will not be available to me if I decide to switch to Postgres later?
I understand that different implementations are different. But I want to avoid what's different, and try to use what's widely implemented so I can switch DBMSs if necessary. For that, wouldn't it be most useful to have the widely implemented features of the SQL standard documented, along with which DBMSs do not implement those features? That would document the differences you mention. Then, in a separate section, the rest of the features, the more different ones, of each DBMS could be listed. That would document the rest of the differences. However, documenting them this way would encourage me to stick with features that many DBMSs support, rather than writing for the specific DBMS I happen to be using, then getting stuck when I need to switch to a different implementation.
To clarify, I'm not asking for MySQL's implementation to be the same as every other DBMS, or every DMBS implementation to be the same, anything about the implementations at all. I'm requesting that the documentation of SQL to focus on what is a standardized subset of SQL so I can write portable SQL. Isn't that why a SQL standard exists?
I don't understand why so many SQL references contain separate sections for different DBMSs. When I write SQL, I want to write SQL, and I want to write it in such a way that it will work on whatever DBMS I happen to be using. I should be able to change to another DBMS if I need to. Why not document the widely implemented subset of SQL features, and list the DBMSs that each construct is not available on? Separate sections could list the rarely implemented and nonstandard features for each DBMS. Dammit, SQL has been standardized for twenty years! Shouldn't I able to write just SQL by now?
You may want to try creating a new profile. That quite often fixes serious problems. If that doesn't help much, try the standard diagnostic, including a clean reinstall of the latest stable version of Firefox from downloaded from mozilla.org. It certainly sounds like something is borked on your computer if you're regularly seeing memory usage that high.
The first bug seems to be bug 915, which is over eight years old! I guess no one is bothered enough by that to fix it. The second might not be a bug according to bug 34415.
I'm not whining, just pointing out basic facts about the drug industry, as many people here seem to be ignorant of them. The drug companies do in fact need lots of money to develop drugs. Do you think all the employees work for free? I'm certainly not advocating that the government fund private research. The drug companies are making good profits for the risks they are taking, and thus need no subsidies.
They are too greedy to help their wives, husbands, children, or parents who are dying from a disease that someone has developed a cure for? Surely there are at least some billionaires who themselves have the diseases that these supposed cures exist for? Why don't they pay for the research on themselves so they can save their own lives? Then scientists could publish the results of the trial. Are the scientists all paid hush money, and the ones who talk are blackmailed, discredited, or "wiped out"? I think you've been watching too many movies.
The create-and-find-compounds bit was performed by the USDA, as well as the initial trials. BMS took over only at the end, and received funding for that from the government. Are you just pasting drug-industry boilerplate, or did you bother to read about the situation we're discussing? I'm well aware that it's expensive to find and test new drugs, but that was already done by the government (which you handwave away as a bad idea below) rather than by the company that's extracted billions of dollars in profits from people with cancer. You've utterly failed to explain how these record profits are justifiable, or why the normal pricing rules on drugs patented by private companies off of publically-funded research were suspended, apart from greed and corruption.
If you bothered to read what I wrote, drug companies need profits from blockbuster drugs to fund research for other drugs. The profits are justified by the enormous risks drug companies take -- they pour billions of dollars into developing new drugs, without any guarantee that they will create any revenue. Go read about Risk-Return Tradeoff for more details.
Bristol-Myers Squibb, on the other hand, is selling it at twenty times the cost of manufacture, because of, uh, the magic of the market, or something like that. Blazing efficiency, there. Can't imagine what would have happened if we hadn't handed them the multi-billion dollar patent rights.
Drug companies cannot possibly sell drugs for near the cost of manufacture. Most of the cost of getting a drug to market is in the research that went into developing the drug. First, chemists and biologists need to create and find compounds to test. Out of several promising compounds, perhaps one of them makes it past preclinical (animal) trials. Out of several of those compounds, perhaps one of them makes it past clinical (human) trials and gets approved for sale. Out of several of those compounds, perhaps only one makes any significant profit. It's these few blockbuster drugs that fund the research to get the next generation of drugs to market. If pharma companies sold drugs for only a small amount more than the cost of manufacture, that would be the end of private-sector drug research. Perhaps you'd rather pay taxes to fund only government-sponsored research instead? I'm sure that idea will go over well with voters.
Surely even multi-billionaires have loved ones who get sick from these diseases? Why don't they pay to have the drugs developed so the cures can be available, even if only to those who are rich enough to afford it? Generally it takes less than a billion dollars to have the drug fully approved by the FDA. It takes much less to fund a small clinical trial to investigate whether a drug is effective. There are plenty of billionaires around with enough money to throw around to develop these cures, if only they existed.
For this reason cures are highly guarded discoveries: there are many cures around we don't have access to, and perhaps never will, either because they threaten an existing sickness market or because the IP pushes the price up beyond our reach. Just because we hear about a cure doesn't mean we'll ever see that cure in the wild
Surely there are researchers involved in finding these hidden cures you refer to. Why don't any of them blow the whistle on this massive conspiracy?
At least Flash is cross-platform, not riddled with security bugs, and works with your favorite browser. Dealing with IE-only sites is much more painful than dealing with IE-only sites.
If you want to run IE, you need to pay Microsoft for Windows. Even if you want to run IE on another operating system somehow, you must still pay for the Windows license to use IE. If you need IE to access certain sites, you must pay Microsoft for the privilege.
each of them have some very nasty long term bugs that have been largely ignored by the fixers.
Are you referring to IE's security vulnerabilities or IE's rendering bugs? What are some examples of correspondingly nasty bugs in the other main browsers?
That's true, but that's not what the GGGP was saying. He said "there's nothing to stop invocations of different methods from both attempting to update the same data inside the vector at the same time" which is false. He's thinking that the lock is applied to the method, so one thread could be adding an element to a Vector at the same time another is trying to delete one. That's a complete misunderstanding of how Java handles synchronization.
It isn't threadsafe for any collection. No matter what collection you use, you need to lock it before you enumerate it if there's a chance another thread might add or delete elements during the enumeration.
It does save the initializing of the new array if it is large enough, but will silently initialize a correctly-sized array if it is too small, and use a larger array if it is too large. The point is that the size could change in between when you requested it and when you added the new element. Read up on multithreaded programming. Statements in Java are not atomic.
The Problem is that the synchronization is applied at the method level. That means there's nothing to stop invocations of different methods from both attempting to update the same data inside the vector at the same time, which can cause bugs that are almost impossible to track down.
You need to read up on how synchronization is done in Java. Any synchronized method will obtain a lock on the object itself, and therefore it is impossible for two different synchronized methods to update the data inside the vector at the same time.
It's somehow strangely comforting that Java programmers still don't know Java well after all these years. A word of advice: just because Java is "simple" doesn't mean you shouldn't pay attention to the details and learn them well.
It's true that you could save an extra array initialization. On the other hand, if another thread adds one more element in between the call to size() and the call to toArray(), that could cost an initialization of a large amount of memory. There's no overall "best" way to write the code; I showed the simplest and the one with the least risk of wasting time.
I clicked thru the first 10 pages or so before I got bored. That's an awful lot of hits about aliens abducting people. We simply have to do something about all these alien abductions!
If you're not convinced about alien abductions, then why would I be convinced about Firefox memory problems, especially because I've personally used Firefox for over a year without any problem whatsoever? I've spent hours digging into this crap. Firefox 2 is simply at least as good as other browsers in the memory arena.
I don't understand the response to this question. I have learned dozens of programming languages, usually ones that have different implementations. When I read them, they do not contain different chapters on different implementations. In C++ books, they discuss C++ and perhaps talk about implementation differences between compilers. For example, they say that an int is a data type that can hold integer values between -32768 and 32767, and can possibly hold larger and smaller values. They may even give examples of some different compilers and their different ranges for ints. But they don't contain completely separate sections on Visual C++ and GNU C++.
Why don't SQL books just explain SQL? Shouldn't I just be able to write SQL code that runs in any DBMS with minimal changes just the way I can write C++ code that compiles with many different compilers and runs on many different OSes with minimal changes? Does it seem like a stupid question? Even so, could someone answer why so many SQL references contain separate sections for different DBMSs, making it difficult to write portable code? Why not just explain SQL and give the differences between different implementations within the same section, instead of covering MySQL, SQL Server, etc. as if they're separate languages?
I understand that different implementations are different. But I want to avoid what's different, and try to use what's widely implemented so I can switch DBMSs if necessary. For that, wouldn't it be most useful to have the widely implemented features of the SQL standard documented, along with which DBMSs do not implement those features? That would document the differences you mention. Then, in a separate section, the rest of the features, the more different ones, of each DBMS could be listed. That would document the rest of the differences. However, documenting them this way would encourage me to stick with features that many DBMSs support, rather than writing for the specific DBMS I happen to be using, then getting stuck when I need to switch to a different implementation.
To clarify, I'm not asking for MySQL's implementation to be the same as every other DBMS, or every DMBS implementation to be the same, anything about the implementations at all. I'm requesting that the documentation of SQL to focus on what is a standardized subset of SQL so I can write portable SQL. Isn't that why a SQL standard exists?
I don't understand why so many SQL references contain separate sections for different DBMSs. When I write SQL, I want to write SQL, and I want to write it in such a way that it will work on whatever DBMS I happen to be using. I should be able to change to another DBMS if I need to. Why not document the widely implemented subset of SQL features, and list the DBMSs that each construct is not available on? Separate sections could list the rarely implemented and nonstandard features for each DBMS. Dammit, SQL has been standardized for twenty years! Shouldn't I able to write just SQL by now?
You may want to try creating a new profile. That quite often fixes serious problems. If that doesn't help much, try the standard diagnostic, including a clean reinstall of the latest stable version of Firefox from downloaded from mozilla.org. It certainly sounds like something is borked on your computer if you're regularly seeing memory usage that high.
The first bug seems to be bug 915, which is over eight years old! I guess no one is bothered enough by that to fix it. The second might not be a bug according to bug 34415.
I'm not whining, just pointing out basic facts about the drug industry, as many people here seem to be ignorant of them. The drug companies do in fact need lots of money to develop drugs. Do you think all the employees work for free? I'm certainly not advocating that the government fund private research. The drug companies are making good profits for the risks they are taking, and thus need no subsidies.
They are too greedy to help their wives, husbands, children, or parents who are dying from a disease that someone has developed a cure for? Surely there are at least some billionaires who themselves have the diseases that these supposed cures exist for? Why don't they pay for the research on themselves so they can save their own lives? Then scientists could publish the results of the trial. Are the scientists all paid hush money, and the ones who talk are blackmailed, discredited, or "wiped out"? I think you've been watching too many movies.
Surely even multi-billionaires have loved ones who get sick from these diseases? Why don't they pay to have the drugs developed so the cures can be available, even if only to those who are rich enough to afford it? Generally it takes less than a billion dollars to have the drug fully approved by the FDA. It takes much less to fund a small clinical trial to investigate whether a drug is effective. There are plenty of billionaires around with enough money to throw around to develop these cures, if only they existed.
At least Flash is cross-platform, not riddled with security bugs, and works with your favorite browser. Dealing with IE-only sites is much more painful than dealing with IE-only sites.
If you want to run IE, you need to pay Microsoft for Windows. Even if you want to run IE on another operating system somehow, you must still pay for the Windows license to use IE. If you need IE to access certain sites, you must pay Microsoft for the privilege.
That's true, but that's not what the GGGP was saying. He said "there's nothing to stop invocations of different methods from both attempting to update the same data inside the vector at the same time" which is false. He's thinking that the lock is applied to the method, so one thread could be adding an element to a Vector at the same time another is trying to delete one. That's a complete misunderstanding of how Java handles synchronization.
It isn't threadsafe for any collection. No matter what collection you use, you need to lock it before you enumerate it if there's a chance another thread might add or delete elements during the enumeration.
It does save the initializing of the new array if it is large enough, but will silently initialize a correctly-sized array if it is too small, and use a larger array if it is too large. The point is that the size could change in between when you requested it and when you added the new element. Read up on multithreaded programming. Statements in Java are not atomic.
You need to read up on how synchronization is done in Java. Any synchronized method will obtain a lock on the object itself, and therefore it is impossible for two different synchronized methods to update the data inside the vector at the same time.
It's somehow strangely comforting that Java programmers still don't know Java well after all these years. A word of advice: just because Java is "simple" doesn't mean you shouldn't pay attention to the details and learn them well.
It's true that you could save an extra array initialization. On the other hand, if another thread adds one more element in between the call to size() and the call to toArray(), that could cost an initialization of a large amount of memory. There's no overall "best" way to write the code; I showed the simplest and the one with the least risk of wasting time.
As I show above, it already has been. In fact, being an AbstractList, it must have generic methods.
It's been years since I've written Java, but
SpecificClass[] sca = scv.toArray(new SpecificClass[0]);
should do it, right?
Okay. How about alien abductions:
http://www.google.com/search?q=alien+abduction
I clicked thru the first 10 pages or so before I got bored. That's an awful lot of hits about aliens abducting people. We simply have to do something about all these alien abductions!
If you're not convinced about alien abductions, then why would I be convinced about Firefox memory problems, especially because I've personally used Firefox for over a year without any problem whatsoever? I've spent hours digging into this crap. Firefox 2 is simply at least as good as other browsers in the memory arena.