473,387 Members | 1,721 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,387 software developers and data experts.

Freeing memory when using Databases

code green
1,726 Expert 1GB
Does mssql_close() implictly call mssql_free_result()?

I am having memory overflow problems (temporarily set to 72mb)
when including three other scripts from one that all query a mssql database.

All three will run on their own without problem so I am looking at trying to free memory within each script.
They are all 'includes' so the garbage collector does not come into play until the main script ends.

Each scripts connects and disconnects from the DB.
Does mssql_free_result() need to be called as well?
Nov 2 '09 #1
4 1415
Markus
6,050 Expert 4TB
@code green
You would expect it to - for the time being, you might explicitly free the results and see if it makes a difference. I'll look into the PHP core and see if it does.
Nov 2 '09 #2
code green
1,726 Expert 1GB
I have read online articles (sorry no reference) studying PHP and memory de-allocation, and in a lot of cases it does not work as expected.
unset() for example rarely frees up memory immediately and can even increase.

Whereas visual output such as echo is memory hungry.
I am going to try disabling the HTML output when running all scripts together (usually from a schedule task) but allow when run seperately
Nov 2 '09 #3
code green
1,726 Expert 1GB
Curious. I used mssql_free_result() at the end of the first script before closing the connection and now no memory overflow problem.

The query returns about 6400 records with 5 fields per record.
Two DATETIME fields, two DECIMAL and one small VARCHAR.
Nov 3 '09 #4
Markus
6,050 Expert 4TB
@code green
So no implicit memory freeing. Strange. I'll take this up on the PHP internals list.
Nov 3 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: disco | last post by:
I am working on this example from a book "C Primer Plus" by Prata 4th edition - p. 672. There is no erata on this problem at the publisher's website. 1) Is it a violation of copyright laws to...
11
by: Rodrigo Dominguez | last post by:
there are sometimes that I use third party libraries, I use some functions that returns char * or structs, etc. sometimes the memory that is returned by those libraries, when I try to free this...
10
by: dmanhr | last post by:
Hi! I'd like to free-up - destroy (myself not GC) object n (Node) with implementing Dispose(). I have linked list: class Node{ CNode nextNode; object data;
6
by: Fernando Cacciola | last post by:
Help me out here please: While watching Brad Abraham's MSDN TV talk about the Dispose pattern, refering to: public virtual void Dispose ( bool disposing ) { if ( disposing ) { <-- WHAT...
4
by: Atul Sureka | last post by:
Hi, I want to free the object memory in C# - like we do using 'delete' keyword in C++. Lets say I have an object of some class and I want to explicitly free the memory. C# do not have any free...
5
by: Amogh | last post by:
Hi, My question is related to setting freed pointers to NULL. After freeing a pointer: 1) Should the freeing routine also be responsible for setting the pointer to null? 2) Or, should the...
66
by: karthikbalaguru | last post by:
Hi, Will 'free' return the memory Immediately to the OS ? Thx in advans, Karthik Balaguru
11
by: vivek | last post by:
Hello, I have a pointer to a main structure which again consists of structures, enums, char, int, float and again complex structures. When i free all the contents of the main structure, it...
25
by: Andreas Eibach | last post by:
Hi again, one of the other big woes I'm having... typedef struct perBlockStru /* (structure) Long words per block */ { unsigned long *lword; } lwperBlockStru_t;
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

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.