When I was using Twitter4j streaming api, I always ended up with memory usage problem. I searched the Internet and someone provided a method which requires modifying original code. I don't know how to do it, so if anyone knows, please help me. Detailed step will be appreciated.
In theory, you can build Twitter4J using Maven. But in most cases, you don't need to build it by yourself. My assumption is that the problem is that you're storing all coming tweets to memory. Try storing them outside the heap such as file system or RDBMS.