Recently I've been thinking about this question a lot. The Megalania, or as it is now known as, Varanus priscus, is the largest lizard known to exist. it was a carnivore that grew to sizes anywhere between 13-23 feet ( there seems to be a controversy on it's average size, so sorry for the margin of ten feet!). Obiviously, this means that it would've needed a lot of meat, presumably from medium to large-sized animals. These were plentiful in its environment (Australia), however, Australia had a number of carnivorous mammalian megafauna that existed in the same time frame as Megalania and presumably competed with it, such as the marsupial lion (Thylacoleo), and the thylacine.

Mammals are much more effeciant predators than reptiles. So, in a land filled with efficient, speedy, mammalian carnivores, how can a reptile manage to compete, and possibly grow to a size of 23 feet? The niche just doesn't seem to be open. Komodo dragons only get away with it because there are no other large predators on the island.

correct but given the very few numbers of Megalania fossils known it is possible they did not physically coexist with the apex predator mammals you mention. Even if they did it may have been for a relatively short period of time. Lastly given the likely slow moving nature of the Megalania (see below) and that it was thought to be venomous (though that is not proven) it is possible it had its own sub-niche and thus again did not greatly directly compete with the mammals you mention.

Bottom line we just don't have enough information/fact on their habitats and periods they lived to say more.

http://www.prehistoric-wildlife.com/spe … iscus.html