Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 12:22:29 PM

Pages: [1]   Go Down
  Print  
Author Topic: Java runtime on VPS  (Read 2569 times)
Albright
Newbie
*
Offline Offline

Posts: 5


« on: June 12, 2009, 09:13:43 AM »

I'm working with a client who recently upgraded from a shared hosting account on Lunarpages to a VPS account. The site needs to periodically fetch data from a database on another server, which it does by firing up a Java app and dumping the data to a CSV file. (It's a bit of a Rube Goldberg-ish system, but it works for now.) Note that I'm not serving JSP pages or using Tomcat or anything like that; just firing up the bog standard Java runtime and having it run an app which connects to and dumps data from a database.

This worked just fine on the shared hosting account, but I can't get the Java runtime to start at all on the VPS account. Trying to just fire up the Java runtime from the CLI results in:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Searching around seems to reveal that this is a common problem on VPSs, but might be solvable with some voodoo by the sysadmins of the physical machine.

I haven't investigated installing an alternate runtime yet, due to lack of time, but before I do, has anyone else run in to this problem - or even better, has anyone been able to solve it?

In conclusion, are all these distracting animated emoticons all along the top of the message field really necessary?
Logged
Albright
Newbie
*
Offline Offline

Posts: 5


« Reply #1 on: June 15, 2009, 11:46:46 AM »

…Tumbleweeds.

I've been experimenting with non-Sun Java runtimes. The closest I've gotten is Apache Harmony, which starts executing the script but then halts with a trace dump. Other runtimes seem to require GNU Classpath, which does not seem installable without manually compiling - I ran out of patience quickly when I saw that this was going to involve several layers of dependency hell. (Why the hell does it need GTK?)

Any tips? Anyone? Anywhere? Please? Suggested to the client that we just go back to the shared hosting account, but he wants that to be the lastest of last resorts.
Logged
conga3
Knows just enough to get in trouble.
Spacescooter Operator
*****
Offline Offline

Posts: 39


WWW
« Reply #2 on: June 15, 2009, 03:52:05 PM »

Have you opened a tech support ticket?  What was their response?  Is Java runtime operations an option on VPS or do you need to step up to dedicated?

Logged
Mitch
Berserker Poster
*****
Offline Offline

Posts: 12838


WWW
« Reply #3 on: June 16, 2009, 05:26:27 AM »

Have you opened a tech support ticket?  What was their response?  Is Java runtime operations an option on VPS or do you need to step up to dedicated?



I agree, contact support@lunarpages.com and they will be able to into more specifics with you about this with relation to your specific account.  Thanks!
Logged

New to Web Site Hosting? Check Out the Lunarpages Blog Hosting Guide!


Follow us @lunarpages on Twitter!
Important Threads: Read This Before Posting! | Lunarforums Rules! | Mitch's Link of the Day!
Also, be sure to check out and subscribe to the Lunartics Blog and the Lunarpages Newsletter !

Need Web Hosting Help? Check out the Lunarpages Web Hosting Wiki. It has tons of tips, tutorials and resources!
Albright
Newbie
*
Offline Offline

Posts: 5


« Reply #4 on: June 17, 2009, 10:46:54 AM »

Ultimately, I did open a support ticket, but got nothing other than your standard budget tech support copy-paste responses. (Not that I blame the techs; that's the nature of the industry.)

I kept experimenting, though, and on Monday, I reinstalled Sun-standard Java and actually got it to work this time. I'm not sure if tech support actually tweaked the server and/or our account in some way and didn't specify it in the trouble ticket, or if I entered some sort of special Konami code during installation to get it to work, or if the stars were just aligned in the correct positions… but it's working for now, at least.
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #5 on: June 19, 2009, 12:16:36 AM »

Hello Albright,

I am glad to hear you got it working after reinstall. Usually, we don't recommend Java services in VPS due to their requirements to the memory. However since you needed a simple program to run, this could have been done. If you get complains from java about low memory, just try running it with memory limiting options like "java –-Xmx256m" to prevent it from trying to allocate more memory than it is required for your tasks.

I hope this helps.
Logged

Kind Regards,
Vlad Artamonov
Albright
Newbie
*
Offline Offline

Posts: 5


« Reply #6 on: June 25, 2009, 11:37:03 AM »

Further follow-up.

It turns out my previous celebratory post was premature. The problems are still occurring off and on.

Doing some research, I found that the Java runtime has some options to restrict how much memory it tries to grab for itself when it starts up, such as perestrelka mentioned above. Using "/usr/bin/java -Xmx16m -XX:MaxPermSize=20m -jar path/to/file.jar", I can sometimes get the script to run correctly, though most of the time there's still error problems of some sort - not necessarily the one in the opening post.

Running the job immediately after the server has restarted seems to greatly increase the probability that it will run correctly. I guess that's to be expected, but we want the job to run via cron twice a day, so restarting the server before it does so isn't exactly convenient.

In conclusion, (headdesk)
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #7 on: June 29, 2009, 01:28:38 AM »


Do you have any services running that you don't use on VPS to disable them to get some more memorfy free?
Logged

Kind Regards,
Vlad Artamonov
Albright
Newbie
*
Offline Offline

Posts: 5


« Reply #8 on: June 29, 2009, 02:56:39 PM »

Oh, probably. There's a whole bunch of stuff running on this thing that I didn't install - it was all on there when the VPS was set up, apparently. Is this the norm in the industry? When we got our FreeBSD VPS from another company, it was a beautiful blank slate; we were able to to install and configure only what we needed from scratch.
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #9 on: July 06, 2009, 01:54:29 AM »

Albright,

If you chose no control panel for your VPS during signup, you should get a bare server with apache, php and mysql installed only. However, if any panel was chosen, you will get the services required for that control panel to work running. This might happen in your case.
Logged

Kind Regards,
Vlad Artamonov
Pages: [1]   Go Up
  Print  
 
Jump to: