This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot allocate memory issue  RSS feed

 
yakkala krishna
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am running unix scp command as below using Runtime.getRuntime.exec();

scp -P10022 -i /home/.ssh/id_ds 2937_filename.xls Username@hostname

following is the syntax in java:

final Runtime r=Runtime.getRuntime(0;
final String[] arg={ "/bin/sh","-c",command};
final Process process=r.exec(arg);


i am getting followin error
java.io.IOException: cannot run program "/bin/sh: java.io.IOException: error=12, Cannot allocate memory

could you please suggest what i need to update to allocate memory in windows side.

Thanks in advance

Thanks,
Rama
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might be running out of memory on the machine. If you do "top" how much free memory do you get
 
yakkala krishna
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jayesh,

Good to see you reply.

As mentioned i used top command in my linux serer. following is the info i fetched regarding memory:

Mem: 1927692k total, 1876608k used,51084k free,27432k buffers

still i am seeing free memory in the server. could you please suggest on this.

Thanks,
Rama
 
fred rosenberger
lowercase baba
Bartender
Posts: 12527
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If my math is right, that says you have less than 3% of your total memory free. That doesn't seem like much to me.

Was this "top" done while your java program (and thus, the JVM) was running?
 
yakkala krishna
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fred,

Thanks for your suggestion.
My web application is deployed in tomcat server. i performed testing by deleting temporary old files and restart the tomcat server.then i am able to send files through web application using SCP.

Following is the memory status after server restart and deleting tmp files:

Mem: 1927692k total, 842488kused, 1101944k free,38752 buffers

could you please suggest for permanent solution. i need to increase memory size or some other solution.


Thanks,
Rama
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to talk to your friendly neighborhood sysadmin. Generally, issues like these are out of the realm of the average developer's skill set. There are ways to get around this issue by tweaking overcommit settings in Linux, but before you go around tweaking settings, you should consult a Linux expert.. Anyways, if you need more memory, you will need the help of your sysadmin anyways
 
Ron McLeod
Saloon Keeper
Posts: 1561
222
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be good to understand why the free memory count increased by 1G after restarting tomcat.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!