File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Why its called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why its called "heap pollution"?" Watch "Why its called "heap pollution"?" New topic

Why its called "heap pollution"?

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
Hi all,

So I came across the term Heap Pollution and after googling I know what it means BUT my issue is , I couldn't relate the name with the scenario. Why its called Heap Pollution? Basically, if I were to guess what it means from the name itself I couldn't have.

Why we say heap is polluted if we are pointing to wrong parameterized structure? Like, Garbage Collection - It makes so much sense.

Also, is heap pollution word got more popular with Java 5? The behavior existed in earlier java versions too. Its just that Java 5 is now more explicitly pointing to that issue as we have Generics.

Anyways, just my thoughts at end of tiring day so may sound little off the track

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

I bet you've never heard of Heap Global Warming, which is even worse

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: Why its called "heap pollution"?
It's not a secret anymore!