It is a common, rather weedy rainforest species growing in both primary and secondary forests, and gallery forests, mostly near the edges of the trees, and generally at altitudes of less than 1000 meters .