Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFQUERY and Memory

Guest
Mar 06, 2008 Mar 06, 2008
Im trying to free up some memory and have a few questions..

Ive read that you can set <CFQUERY name="session.queryname"> in order to cache the record set. Im confused about how this works. Does this caching replace the use of memory that a query would use if it were named without the "session."? Or does it put the record set into memory in a manipulatable form?

Hopefully this makes sense. We're getting a 500 error message when trying to execute the template. We've narrowed it down to my page plus several others that run at the same time that are also receiving the error. So anyway we're looking for a way to free up memory during the running of our templates. If anyone has any thoughts on this it will be appreciated.

Thanks ahead of time!



TOPICS
Database access
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 06, 2008 Mar 06, 2008
quote:

Originally posted by: BigFeetBigShoes
Lets pretend that it's alot.. So regardless of the amount of data and the memory thats being used, is there away to lessen the amount of memory that is used?

The best way is to reduce the amount of data returned to Cold Fusion. Ways to achieve this are:
select only the fields you need.
select only the records you need
trim character fields.

Given the way you said you are collecting your data, some of these methods may not be available to you.
Translate
LEGEND ,
Mar 06, 2008 Mar 06, 2008
making a query a session variable makes it available to other pages so you don't have to keep running it. All queries can be manipulated to a certain with query functions

If you are having memory issues that you think might be query related, how much data is it bringing back?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 06, 2008 Mar 06, 2008
Probably between 1000 and 10000 rows..one thing I did not mention is they are coming from a VHI to Query call and not an actual cfquery. (VHI is called through a customer tag that scrapes the user interface of a mainframe and returns a recordset to coldfusion) We take what we get back in the VHI recordset and load each record into a table. Is there away to dump whats kept in the temporay memory after each insert statement is ran?

If there is something that can be done with CFQUERY then I figured I would try it on the VHI custom tag along with my insert statements.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 06, 2008 Mar 06, 2008
If you write your query results to a file, the file size will give you a rough idea of how much memory you are using.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 06, 2008 Mar 06, 2008
Lets pretend that it's alot.. So regardless of the amount of data and the memory thats being used, is there away to lessen the amount of memory that is used?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 06, 2008 Mar 06, 2008
LATEST
quote:

Originally posted by: BigFeetBigShoes
Lets pretend that it's alot.. So regardless of the amount of data and the memory thats being used, is there away to lessen the amount of memory that is used?

The best way is to reduce the amount of data returned to Cold Fusion. Ways to achieve this are:
select only the fields you need.
select only the records you need
trim character fields.

Given the way you said you are collecting your data, some of these methods may not be available to you.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 06, 2008 Mar 06, 2008
Are you returning ALL fields in the tables (tblname.*), or are you specifying explicitly which fields you want to return?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 06, 2008 Mar 06, 2008
Yes, Im returning all fields from the VHI to Query call. It returns a recordset just like a query.

On an Insert statement, I wouldn't think there would be as much memory being used compared to a select statement. But correct me if Im wrong..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources