# Permission Denied and OOM error when running "java -version" command

**URL:** <https://forums.docker.com/t/permission-denied-and-oom-error-when-running-java-version-command/1837>\
**Category:** General\
**Created:** [June 12, 2015, 10:21am UTC](https://forums.docker.com/t/permission-denied-and-oom-error-when-running-java-version-command/1837 "2015-06-12T10:21:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunviswa](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@arunviswa](https://forums.docker.com/u/arunviswa)\
**Post date:** [June 12, 2015, 10:21am UTC](https://forums.docker.com/t/permission-denied-and-oom-error-when-running-java-version-command/1837/1 "2015-06-12T10:21:46Z")

</div>

Hi,

I’ve running docker in Centos 6.6. I’ve not actually installed it instead I’ve downloaded the latest docker binary from [https://get.docker.com/builds/Linux/x86\_64/docker-latest](https://get.docker.com/builds/Linux/x86_64/docker-latest).

In this VM I’ve created the centos container by the following commands.

> cat ./images/docker-centos-base-master/centos65.tar.xz | ./docker-latest import - centos/mycontainer  
> ./docker-latest create --privileged=true -t -i centos/mycontainer bash  
> ./docker-latest start -a -i e1ab024063a5

Container started successfully in interactive mode.  
I’ve copied the jdk7 rpm to the container and installed it using “rpm” and then I tried “java -version” command

bash-4.1# java -version  
Java HotSpot™ 64-Bit Server VM warning: INFO: os::commit\_memory(0x00007f0480815000, 2555904, 1) failed; error=‘Permission denied’ (errno=13)  
'#  
'# There is insufficient memory for the Java Runtime Environment to continue.  
'# Native memory allocation (malloc) failed to allocate 2555904 bytes for committing reserved memory.  
'# An error report file with more information is saved as:  
'# /opt/jdk1.7.0\_72/bin/hs\_err\_pid9.log

So I tried running it from the installed location and end up with the same error.  
bash-4.1# cd /opt/jdk1.7.0\_72/bin/  
bash-4.1# java -version

Almost 8GB of my memory is still free but I’m not sure why this error is coming.  
bash-4.1# free -g  
total used free shared buffers cached  
Mem: 15 7 8 0 0 6  
-/+ buffers/cache: 0 15  
Swap: 3 0 3

Any help will be really appreciable.

Thanks,  
Arun V
