473,378 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

memory shortage

hello,
I have a trouble when I run a C program.
It have several big pointer variables like 4 by 5000000.
The program is supposed to calculate that big variables with
different parameters repeatedly.
When process run several times, the first serveral runs are fine but
all the memory(main memory and swap memeory) is out of and
it is stop finally.
I am pretty sure that I free every variables for a each run.

My questions are,

1. if the process is needs more memory even though the variables
have been released with free()
2. what is the best way to manage memory
3. is it better to break down a big variables into smaller variables
and run more
4. if there is memory leak, how can I find it?

Any suggestion and helps would be appreciated.

Thanks,

Chang

Nov 13 '05 #1
1 1603
Chang Byun <by***@rpi.edu> wrote in message news:<bm***********@newsfeeds.rpi.edu>...
hello,
I have a trouble when I run a C program.
It have several big pointer variables like 4 by 5000000.
How have you allocated space for these variables. Static allocation not
adviced, if you use dynamic allocaton then make sure you check on the return
value. The program is supposed to calculate that big variables with
different parameters repeatedly.
When process run several times, the first serveral runs are fine but
all the memory(main memory and swap memeory) is out of and
it is stop finally.
Processes, IPC are not discussed here thats off topic. But pretty sure there
is a leak somewhere !
I am pretty sure that I free every variables for a each run.
Really ..
My questions are,

1. if the process is needs more memory even though the variables
have been released with free() Use malloc/realloc() and check on the return values 2. what is the best way to manage memory 3. is it better to break down a big variables into smaller variables and run more
Depends on the need for allocation. 4. if there is memory leak, how can I find it?
Use memory diagnostics tools. Google might be of some help.
Any suggestion and helps would be appreciated.

Thanks,

Chang

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: xixi | last post by:
hi, we are using db2 udb v8.1 for windows, i have changed the buffer pool size to accommadate better performance, say size 200000, if i have multiple connection to the same database from...
6
by: hauger | last post by:
(DB2 V.8.1) Hi @ll, when i start my DB2 and my application connects and makes some SQL Tests my system is running out of memory (UNITED LINUX 1.0) goes slow and needs very very long time to...
4
by: Chang Byun | last post by:
I have question about memory allocation. I have a trouble when I run a C program. My C program has several big double pointer(** var) variables to structure data like 4 by 5000000. It is...
13
by: Michael B Allen | last post by:
Hi, I've tried to write the *simplest* memory allocator possible. I think it would be useful in many cases such as allocating memory on stack as a poor man's garbage collection perhaps. I was...
3
by: www.dir | last post by:
I am developing C# application that every 10 seconds refreshes TreeView control. I am using 3 custom classes for renewing the TreeView control. And It seems that I do not free some resources, so...
7
by: Fernando Barsoba | last post by:
Hi, After following the advice received in this list, I have isolated the memory leak problem I am having. I am also using MEMWATCH and I think it is working properly. The program does some...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
31
by: pradeep | last post by:
Hello friends: I have the following code, char* MyClass::MyMethod() { char* ptr = new char; // space for NULL terminator ptr = "hello"; return ptr; delete ptr;
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.