LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-31-2014, 05:11 AM   #1
ramset6969
LQ Newbie
 
Registered: Mar 2014
Posts: 4

Rep: Reputation: Disabled
Problem with java


Hi,when I launch a java command, it gives me an memory allocation error.

[root@WEDOCOL01 ~]# cat /proc/version
Linux version 2.6.32-431.el6.x86_64 (mockbuild@x86-023.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Sun Nov 10 22:19:54 EST 2013

[root@WEDOCOL01 /]# java -version
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000758c00000, 176160768, 2097152, 0) failed; error='Cannot allocate memory' (errno=12)
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x000000060a400000, 350224384, 2097152, 0) failed; error='Cannot allocate memory' (errno=12)
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00007fb3e4200000, 266338304, 2097152, 0) failed; error='Cannot allocate memory' (errno=12)
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

however, if you launch the java command, specifying a low heap size, it does not give me error:

[root@WEDOCOL01 /]# java -Xmx102M -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

but, just get up even slightly, the error returns, even if in reduced form

[root@WEDOCOL01 /]# java -Xmx103M -version
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000f4600000, 23068672, 2097152, 0) failed; error='Cannot allocate memory' (errno=12)
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

could you help me?

Thanks!
 
Old 03-31-2014, 02:45 PM   #2
action_owl
Member
 
Registered: Jan 2009
Location: 127.0.0.1
Distribution: Fedora, CentOS, NetBSD
Posts: 115

Rep: Reputation: 17
Not trying to be a smartbutt, but.. do you actually have enough memory?
 
Old 03-31-2014, 04:47 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 14,016

Rep: Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889Reputation: 1889
how about running java as a normal user and NOT as root
from the "el6" part of Linux version 2.6.32-431.el6.x86_64 you are running ether RHEL6 or CentOS 6

so HOW!!! did you install java
there are two versions
the already installed OpenJDK 1.6 ( or 1.7) in CentOS6.5
and the Oracle JAVA

the two are incompatible

you need to use one OR the other

for the already installed ( should have been auto installed at time of OS install )
for 1.7
Code:
su -
yum install java-1.7.0-openjdk
for the older 1.6
Code:
su -
yum install java-1.6.0-openjdk
for Oracle's JAVA
you need to install the Oracle's software repo

it looks like you replaced the already installed OpenJDK with Oracles JAVA

did you also reset "alternatives" to reflect the change

Last edited by John VV; 03-31-2014 at 04:51 PM.
 
Old 04-02-2014, 05:15 AM   #4
ramset6969
LQ Newbie
 
Registered: Mar 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
the problem was the high cache memory configured:

[root@WEDOCOL01 ~]# free -m
total used free shared buffers cached
Mem: 32109 31852 257 0 282 30914
-/+ buffers/cache: 654 31455
Swap: 24575 0 24575
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Java Woes: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available ... chytraeus Slackware 10 11-27-2010 10:04 AM
Java Problem dawuad Red Hat 2 11-02-2005 11:27 PM
Java Problem bwaynej2002 Linux - Software 4 01-21-2004 06:40 PM
Java problem oicdn Linux - Software 10 01-08-2004 07:00 PM
java vm problem kylo Linux - Newbie 0 02-09-2002 03:26 PM


All times are GMT -5. The time now is 06:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration