0

I am running mCruiseOn Server, which is a java based server side application (sockets, multiple threads, memcached, mysql) on a Micro EC2. It has been crashing often. I suspect memory usage may have killed it.

How to you find out which program is using too much memory

I read through this and it was very useful. Now I need to know if my application crashed due to memory shortage. Any system log that has that information ?

2 Answers 2

1

If a well-designed application crashes due to lack of memory, it should give some useful information about this. Try running invoking the application from the Terminal, and examining the messages.

2
  • I wonder how the question was not good enough for someone.
    – Siddharth
    Jul 15, 2012 at 6:57
  • @Siddharth Who knows. Maybe they didn't read carefully, and thought you were trying to report a bug (which would be off-topic here). In any case, you'll be happy to know that random upvotes tend to more than cancel out random downvotes (especially in terms of reputation gained/lost, since an upvote adds more rep than a downvote takes away). Jul 15, 2012 at 15:49
0

I was redirecting all output to a file using > my.log & and then using tail -f my.log to view all messages. For some reason all e.printstacktrace were not in the my.log. I was missing a RuntimeException and the exact root cause a ArrayOutofboundException.

4
  • 1
    It's unclear if this is intended as an explanation of the problem, or as an indication that you have not yet solved it. If the latter, then this should be an edit to your question (and you could leave a comment on my answer too if you want). Also, please note that you have accepted my answer, which means this question is considered to be "solved." If none of the answers here are sufficient to your needs yet, then I recommend un-accepting my answer (click the check mark again), so people know you're still looking for help. Jul 15, 2012 at 15:54
  • However, if you now know the cause o the crash, you should report that as a bug rather than reopening this question (as Ask Ubuntu is not a good place to report bugs). Jul 15, 2012 at 15:55
  • thanks for your feedback. I'll be more careful with my questions. That said, your answer helped me come back to my application rather than looking for a bug in the OS. My answer to my question is just a way to help someone understand what I did to solve my issue and was the root cause of my issue. I could not imagine that a > my.log, would not capture e.printstacktrace messages. Too report to consider I would say. Again, thanks for your help. This helped.
    – Siddharth
    Jul 15, 2012 at 16:45
  • Error messages are typically written to stderr. > file only redirects stdout, so to get all output redirected to file, use > file 2>&1
    – geirha
    Jul 15, 2012 at 16:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .