First off: always remember it's space fantasy, not science fiction.
Obviously, which is why I mentioned the possibility of evolution working differently. Just because I take the time to identify the issues raised by a question, that doesn't mean I'm blind to the answers. It just means I'm thorough in laying out the terms of the discussion. And comparing the in-story phenomenon to what we know about real-world evolution gives us a starting point, so we can work from there toward a theory of how the fictional version differs.
Secondly, there's plenty of precedent for this kind of thing going all the way back to the dianoga in ANH and the mynocks & space slug in tESB.
I thought of the dianoga, but it didn't seem to me that it actually fed on the trash -- otherwise why bother to compact the trash, instead of just letting the critter digest it? Besides, one would assume that the Death Star's trash would include a lot of organic waste, like leftover food and such -- quite possibly the source of the incredible smell Leia discovered.
I thought of the mynocks too, and I did have the impression they posed a threat to the integrity of the Falcon, but the film was unclear on whether they actually digested the inorganic matter or if it was more of a burrowing instinct, like rats chewing through wiring and insulation.
As for the space slug, one could presume it gets its nourishment from the crews of the ships it eats -- or that it usually eats some kind of spacegoing life form and the only reason it tried to chomp on the Falcon was because the Falcon had already flown into its gullet. After all, given that the odds of successfully navigating an asteroid field are approximately 3,720 to 1, it stands to reason that very few space pilots are crazy or reckless enough to attempt it, and it's therefore unlikely that spacecraft are the creature's primary form of sustenance. (Although, okay, Wookieepedia says that Exogorth mainly feeds on minerals from other asteroids, which would make sense, since there's probably not a lot of organic matter even in a fantasy asteroid field like that one.)