• Post Reply Bookmark Topic Watch Topic
  • New Topic

out of memory error in simple app  RSS feed

 
Max Benjamin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm trying to build a (for now) simple app that speaks text entered into a JTextarea. When I run the app and attempt to have it speak the text entered I get the following error:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
I think I may need to start a new thread when the "speak text" button is pressed but so far I've been unable to correctly implement this. Can anyone give me a hint or suggest a better design. Here's the code to the app in three files:







Thanks,
Max
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may just need to give Java more memory; try using something like

java -Xmx128m PhonemeApp

to start your program. You can use even bigger numbers in place of "128" to give that many megabytes to Java for its heap.
 
Max Benjamin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick reply. Still getting the same error however.
Best,
Max
 
Max Benjamin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem was with the setter method in the phoneme speaker class, stupid mistake.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!