system
Given the following post, respond as if you're commenting on Reddit:
human
[Dune] What would such huge creatures like sandworms actually eat?

So if I remember right the worm produced the spice... But how can the worms survive themself? Being insanely large the sandworms must have consumed tons of biomass not to starve... But in their habitat there was only... Sand, wasnt it?
gpt
The sand worms primarily eat sand plankton, which are actually the first stage in the sand worm life cycle, which is hypothetically trophically contained.

1) Sand plankton are microscopic organisms that feed on melange. Sand plankton mature into an adolescent form called a "sand trout" or "Little Maker". 

2) Sand trout are free swimming "half animal, half plant" creatures that hoard water in cisterns underground bound by their own bodies. Given their half plant (even though they're mostly away from sunlight) nature, they are likely the autotrophic portion of the system and are said to contain a sweet syrup. Melange grows as a fungus within the underground cisterns feeding on trout excrement, and a spice blow happens when the build up causes the cistern to rupture (this kills the majority of the trout involved, but apparently not all).

3). Sand trout mature into sand worms, who presumably spore sand plankton.