f



CGI program ate up memory upto 40% help!

I am writing a few CGI scripts in C to handle certain stuff, and saw the memory cache rocket up to 400 megabytes every time I execute one. I am saved by extra swap space however. Where am I doing wrong?

I used lot of headers like dirent, stat, string, mysql, gd, and have closed/destroyed useless garbage at correct places of the script. Are there any other things I need to be aware of?

I run Linux BTW and the server is Apache.
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
0
Vijay
4/1/2014 6:49:51 AM
comp.lang.c.moderated 1019 articles. 0 followers. Post Follow

0 Replies
437 Views

Similar Articles

[PageSpeed] 8

Reply:

Similar Artilces:

[ann] C/C++ CGI programming Ch CGI released
SoftIntegration, Inc. released Ch CGI 3.5. It is free and runs across platform. Ch is C/C++ interpreter for cross-platform scripting, 2D/3D plotting, numerical computing, shell programming. Ch CGI toolkit is a C++ toolkit for CGI programming in C/C++. Ch CGI supports wide characters and easy-to-use CGI APIs similar to JSP and ASP. Ch CGI allows C/C++ developers to write CGI programs without lengthy compile/link/execute/debug cycles. Ch CGI is an ideal application programming interface for various Web applications across different platforms. The same Ch CGI scripts can run in diffe...

C programming and freeing memory
Hello, I'm moving an application over from a solaris platform to linux. When the program attempts to free previously allocated memory, I get a segmentation fault. It ran fine under solaris. The section of code in question is a loop where an unsigned int pointer is allocated memory and used, and then freed. This works fine for the initial pass through the loop, but the second time through the loop, it seg faults on the freeing of this memory. Is there something that's needed that I'm neglecting that wasn't needed (or overlooked) when running under solaris?...

Help me, a friend of mine wrote a program in C# and I wrote the same program in C..His is faster than mine on the same machine...How Come ?
Hi every one, Me and my Cousin were talking about C and C#, I love C and he loves C#..and were talking C is ...blah blah...C# is Blah Blah ...etc and then we decided to write a program that will calculate the factorial of 10, 10 millions time and print the reusult in a file with the name log.txt.. I wrote something like this #include <stdio.h> unsigned int fib (int n); int main() { FILE *fp; unsigned int loop =1 ; if ( (fp = fopen( "log.txt", "a" )) != NULL ) for (loop; loop <= 10000000 ; loop++) { fprintf(fp,"%u\n",fib(10)); } fclose ...

Help is needed for C program compiled by C++
Hi, I need your help. I have a legend C program that works well after it was compiled under Visial Studio 6. Now a new version of Visial Studio 2005, V8 is installed on my machine. And I failed to generate its *.exe file. What I have done is: 1. Create a project under C++; 2. Select 32-bit window console project; 3. Add my *.c files into it. 4. Compile it. Error information: When I included statement: #include "stdafx.h" Error information: Error 1 fatal error C1853: 'Debug\Filter.pch' precompiled header file is from a previous version of the compiler, or the precompiled ...

How to check memory leak in C/C++ programs?
Hi, I am writing some hybrid application s using C/C++ modules together....Here I have created and used a lot of malloc(...) and new(...) operators. I am interested in checking on the optimisation part of the programs...like memory consumed,memory leak , processor utilisation and like...most of the info I got from task manager...however still I cand find way to check on memory leaks... Suggestions required on some good procedures or tools.. Thanks in advance, a.a.cpp :-) Try using boehm-gc garbage collector, valgrind and some other malloc libraries. On 2005-05-13, iceColdFire <icold...

Effect of forgetting to release memory in C/C++ program
If I forget to release memory with free command after calloc or malloc in C program, or forget to release memory with delete command after new in C++ program, then what would happen to the memory space? Will it be released when the program is finished? Or won't it be released until the system reboots? Or what else? Thanks. Kuhl <chen_zhitao@yahoo.com> wrote: > If I forget to release memory with free command after calloc or malloc > in C program, or forget to release memory with delete command after > new in C++ program, then what would happen to the memory space? Will > ...

passing data between Java program and C program--help
Can I pass data between a java program and a C program on the same machine? what machanism should I use? thanks, wh On Sun, 20 Jul 2003 23:40:05 -0400, "pipi" <shengwei@egr.msu.edu> wrote: > Can I pass data between a java program and a C program on the same machine? > what machanism should I use? > thanks, As folks have told you previously, there are several ways to do this depending on what you need and exactly what form this C program takes. 1. JNI. THis allows you to write C/C++ code that can be called directly from your Java code. See the JDK docs and...

"Memory as a Programming Concept in C and C++"
I have just found a very interesting book: "Memory as a Programming Concept in C and C++" Frantisek Franek 2004 >http://www.amazon.com/exec/obidos/tg/detail/-/0521520436/qid=1102475743/sr=1-1/ref=sr_1_1/104-6753470-7335150?v=glance&s=books In switching some code from Java to C++ for efficiency considerations -- the main challenge is in moving from a garbage collector to your own memory management! Every C++ programmer worth his/her pepper, should get this book! It's nothing to Sneeze At! -- Regards, Casey [ See http://www.gotw.ca/resources/clcm.htm for info ...

"Memory as a Programming Concept in C and C++"
I have just found a very interesting book: "Memory as a Programming Concept in C and C++" Frantisek Franek 2004 >http://www.amazon.com/exec/obidos/tg/detail/-/0521520436/qid=1102475743/sr=1-1/ref=sr_1_1/104-6753470-7335150?v=glance&s=books In switching some code from Java to C++ for efficiency considerations -- the main challenge is in moving from a garbage collector to your own memory management! Every mixed language/C++ programmer worth his/her pepper, should get this book! It's nothing to Sneeze At! -- Regards, Casey ...

C program is standard C++ program?
I want if "a C program is a standard C++ program, but not vice versa" is a correct statement? In a C++ program, we can use standard C libraries. However, we cannot use C++ libraries inside C program. Please advise. thanks!! strutsng@gmail.com wrote: > I want if "a C program is a standard C++ program, but not vice versa" > is a correct statement? No. void template() { } int main() { template(); } is a valid C, but invalid C++. Check your favorite textbook (you do have one, don't you?) or google for more informations on C and C++ incompatibilities. > ...

Help needed for C/C++ programming for ARM evaluation board
Dear all, I would like to program the ARM evaluation board with C++. I have some experience with the ARM assembler. - Do I need to set some compiler directives or constants in the program code? - I need to access memory addressed hardwares. Can I do this with pointers in the normal way? Thank you very much! Peng >Dear all, >I would like to program the ARM evaluation board with C++. I have some >experience with the ARM assembler. >- Do I need to set some compiler directives or constants in the program >code? The directives are the usual for any program i...

Using Matlab Visualization to help Debug C/C++ programs
Hi- I am trying to do something,and perhaps I should not be.... I have some code running some complex algorithms written in C/C++ in Visual Studio. I did not write the original code, however, I have been tasked with helping debug it. I have some tools in matlab that i can run after the code has run on data output files to visualize what happened. What I would like to do is be able to either get data from these files, or the C/C++ algorithm in real time so that I can see what is happening as I step through the visual studio debugger... Even if I have to write a mex function t...

How to compile C++ program with templates to pure C or C++ program without templates?
Hi, I heard that debug some C++ templates is very difficult. I'm wondering whether it is possible to compile C++ program with templates to pure C or C++ program without templates? Best wishes, Peng In article <1129128623.514540.179850@g14g2000cwa.googlegroups.com>, PengYu.UT@gmail.com <PengYu.UT@gmail.com> wrote: >I heard that debug some C++ templates is very difficult. I'm wondering >whether it is possible to compile C++ program with templates to pure C >or C++ program without templates? The point of using templates is to not do that, since, that's also d...

Compiling a C program through another C program
As "spawnl" executes an exe through C code., similarly how can we compile a C program through another C program (on Windows platform) ? On Sep 28, 8:29 pm, Ajinkya <kaleajin...@gmail.com> wrote: > As "spawnl" executes an exe through C code., similarly how can we > compile a C program through another C program (on Windows platform) ? Command in unix platform will do too... On Sep 28, 10:29 pm, Ajinkya <kaleajin...@gmail.com> wrote: > As "spawnl" executes an exe through C code., similarly how can we > compile a C program through another ...

Web resources about - CGI program ate up memory upto 40% help! - comp.lang.c.moderated

Program - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

AM Full Program - ABC News (Australian Broadcasting Corporation)
On Saturday's program: With schools returning in the week ahead, there's concern that thousands of Victorian teachers are not properly qualified ...

Mac users can now try out new Microsoft Office features early with ‘Office Insider’ program
Microsoft opened up a beta test program for Windows users last November, letting Microsoft Office fanatics get early access to upcoming new features. ...

European authorities angered by VW's North American compensation program
... Government/Legal , Volkswagen , Diesel Volkswagen is under attack by European legislators after refusing to expand its US compensation program ...

Microsoft opens Office Insider program to Mac users
Microsoft has decided to let Mac users participate in its Office Insider program. It gives users running the popular suite on an Apple computer ...

Facebook tests program to boost diversity in the workplace
... giant wants to increase the number of minorities in its workforce which is overwhelmingly white and male. Facebook has launched a program to ...

How Washington's Youngsters Turned The Program Around
Ask historically great programs like Texas football or UCLA basketball; losing has a way of compounding itself in college sports. With constant, ...

Women outnumber men in the top game design school's graduate program
... the top video game design school in the United States, as ranked by The Princeton Review women outnumber men in its game design graduate program. ...

WITC-Superior suspends composite technology program
... School officials said low enrollment and lack of local employment opportunities led to suspension of the school's composite technology program. ...

Microsoft Opens Office Early-Access Program to Mac Users
Mac users can now join the Office Insider program as part of a new round of updates.

Resources last updated: 1/27/2016 2:33:24 AM