I have a question regarding to a strange behavior of my Java EE application. I had created a @Singleton EJB to schedule a process.
@Singleton
@Startup
public class BackgroundEmailLoader {
@PostConstruct
public void init (){
DO SOMETHING
}
@Schedule(hour="*", minute="*/1", second="0", persistent=false)
public void loadNewEmailsJob() {
// TO SOMETHING
}
}
Now every minute when the job starts, a new Thread (Default-EJB) is created and all other Threads of this task are still running. After some minutes there are a lot of Threads created. Is this a normal behavior? Could this cause a memory problem?
Technology Stack: Wildfly 8, Java EE 7