using more than 700Mb of RAM

using more than 700Mb of RAM

I have a code than can use more than 1 Gb of RAM. However once the memory needed gets above about 700 Mb I get a memory fault.

I have come across this before and have solved in the past under INtel compiler 7.1 on RedHat 8 using teh -static command. Though I can no longer find out why this worked. I am now trying under RedHat 9 and yes I know that this is not supported. -static now couses an error. As I can no longer figure out why I was using -static anyway I have decided to post in the hope that someone can help, if not in solving the issue then atleast with my level of knowledge.


4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

If your assertion is correct, you should not be close to any fixed limit. I run programs which use more than 2GB on RH8, which use several methods of allocating memory. Have you tried compiling with runtime error checking enabled (-C -g) with and without optimization? That wouldn't tell you anything about Cray pointer allocated memory, but it should tell you about various bounds transgressions.

The error (memory fault) occurs at the end of the compile and results in no exectable being created.

I was able to duplicate the error under REDHAT 8 if I did not compile with -static.

The default Linux kernel on IA-32 loads shared libraries at 1 GB, which limits the contiguous address space available to your program. You will get a load time error if your program + static data exceed this. This could be what you are encountering under Red Hat 8.

The possible workarounds are:
1) build with -static, ie don't load any shared libraries.
2) allocate some of your data differently, on the heap or on the stack, which will put it at a higher address than the shared libraries.
3) rebuild your Linux kernel so that the shared libraries get loaded at a different default address
4) use the prelink command to place the shared libraries that you need at a different (higher) address.

I do not know how any of this relates to RH9. But you could still try dynamic allocation (eg ALLOCATE in F90), or putting array data on the stack with -auto (remember to increase the maximun stacksize with ulimit -s 1000000).


Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!