Sponsored Content
Operating Systems Linux Red Hat Memmove fail on 4 Gb+ raster under RHEL 64 bit Post 302914315 by jim mcnamara on Sunday 24th of August 2014 05:21:51 PM
Old 08-24-2014
4294967296 is 4GB; 4294967295 is usually the limit to the size of what an uint32_t pointer can reference. Change your datatype.

However, consider:
Your object must exceed that value or you have exhausted heap memory or exceeded the process memory limit if one is set. What exact error did you get? Fix your code to display what the error is, i.e.

Code:
   // you need to include <errno.h>
   if( !lbuf1 )
   {
      fprintf(stderr, "Fatal error %s\n", strerror(errno));
     // or use perror
     // perror("Fatal error");
      return( -2 );                // insufficient memory
   }

Did you check:
ulimit -a for the process. What does free show? While the code is running?

There are other factors that can also limit allocating giant chunks of memory - heap fragmentation. I do not know how to report that on RH or CentOS from the command line. I do know you can get heap information by writing C code to look at anonymous memory in /proc system-wide.

Heap framentation can occur when you make a bunch of calls to malloc or realloc in succession where the size continually doubles. And there are other process that tie up substantial heap memory or shared memory. You get to a point where the contiguous size chunk you want is not available but the total free memory (made of lots of smaller chunks) exceeds what you need. java is notorious for that - so much so that one of the startup parms allows you to force java to get max possible heap when it first starts.

Start by finding out the exact error, you are assuming ENOMEM.

Last edited by jim mcnamara; 08-24-2014 at 06:28 PM..
 

7 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Programming

q on memmove()

Besides syntax-related issues, is there anything else I should be aware of when using memmove() ? If misued, can it create runtime errors ? (3 Replies)
Discussion started by: JamesGoh
3 Replies

3. Shell Programming and Scripting

Learning - Why does this bit of code fail

In bash: for i in 1 2 3 4 5 do tmp_${i}=$i echo $i done It gives error on executing tmp_1=1, and so on... Why? If I executed this in prompt, not from script, it shouldn't make a subshell should it? please use "code" tags! thanks... (2 Replies)
Discussion started by: StuartH
2 Replies

4. Red Hat

Wrong ELFCLASS64 in RHEL 5 64 bit

Hi, I am using DB2 9.7 , configured odbc.ini file and exported environment variables but I am getting the following error. error while loading shared libraries: libodbc.so.1: wrong ELF class: ELFCLASS64 Kindly help. (4 Replies)
Discussion started by: roopalidalvi231
4 Replies

5. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

6. Red Hat

DNS Service not Start in RHEL 6.4 64 bit

Hi All, I am new to linux and i am configuring DNS server but while i restart service it shows below given error. Please help to solve this error. # /etc/init.d/named restart Stopping named: Generating /etc/rndc.key: ... (2 Replies)
Discussion started by: Chintanghanti
2 Replies

7. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
Heap::Elem::NumRev(3pm) 				User Contributed Perl Documentation				   Heap::Elem::NumRev(3pm)

NAME
Heap::Elem::NumRev - Reversed Numeric Heap Elements SYNOPSIS
use Heap::Elem::NumRev( NumRElem ); use Heap::Fibonacci; my $heap = Heap::Fibonacci->new; my $elem; foreach $i ( 1..100 ) { $elem = NumRElem( $i ); $heap->add( $elem ); } while( defined( $elem = $heap->extract_top ) ) { print "Largest is ", $elem->val, " "; } DESCRIPTION
Heap::Elem::NumRev is used to wrap numeric values into an element that can be managed on a heap. The top of the heap will have the largest element still remaining. (See Heap::Elem::Num if you want the heap to always return the smallest element.) The details of the Elem interface are described in Heap::Elem. The details of using a Heap interface are described in Heap. AUTHOR
John Macdonald, john@perlwolf.com COPYRIGHT
Copyright 1998-2007, O'Reilly & Associates. This code is distributed under the same copyright terms as perl itself. SEE ALSO
Heap(3), Heap::Elem(3), Heap::Elem::Num(3). perl v5.8.8 2007-10-23 Heap::Elem::NumRev(3pm)
All times are GMT -4. The time now is 06:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy