P
PhoneJack
I am writting an algorithm that generates very large tables in dynamic
memory on a linux system. These 2 tables are of the order of (30,000 x
30,000). They are being generated by the following code:
std::vector <short int*> table;
for(i=0; i < 30000; i++) {
row = new short int[30000];
table.push_back( row );
}
The algorithm crashes before creating the table. There is also no
feedback from the command line as to why the system crashes. I need to
determine two things:
1) What is the EXACT error that is produced by the system. Is there a
way to create an error log file that lists all errors generated by the
system at the time of the crash. Maybe, for example, it could show that
mmap failed to allocate enough memory, etc.
2) I need a way to predict the amount of memory that will be used by
the system. What size, in bits, would this table be? Is a SHORT INT
16bits when used in the vector class?
I would think that size = (30000)(30000)(16)
Thanks
memory on a linux system. These 2 tables are of the order of (30,000 x
30,000). They are being generated by the following code:
std::vector <short int*> table;
for(i=0; i < 30000; i++) {
row = new short int[30000];
table.push_back( row );
}
The algorithm crashes before creating the table. There is also no
feedback from the command line as to why the system crashes. I need to
determine two things:
1) What is the EXACT error that is produced by the system. Is there a
way to create an error log file that lists all errors generated by the
system at the time of the crash. Maybe, for example, it could show that
mmap failed to allocate enough memory, etc.
2) I need a way to predict the amount of memory that will be used by
the system. What size, in bits, would this table be? Is a SHORT INT
16bits when used in the vector class?
I would think that size = (30000)(30000)(16)
Thanks