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

loop problems/memory problem

I have a BIG Problem, I need to create a program that will loop 24x7 to check the database and it wouldn’t consume a lot of memory. My platform is vb6 or .net Any advise Please..
Oct 1 '07 #1
24 1702
cugone
20
You could have a timer that checks the database every hour or so for new records instead of having it run constantly. (1 hour is 3,600,000 milliseconds if you need to know. :P )
Oct 1 '07 #2
Killer42
8,435 Expert 8TB
I have a BIG Problem, I need to create a program that will loop 24x7 to check the database and it wouldn’t consume a lot of memory. My platform is vb6 or .net Any advise Please..
What's the problem, exactly? This sounds pretty simple to create. I'd probably recommend going with a Timer control, as the prior message suggested.

Why should it use a lot of memory? If your table contains a huge number of records, and you keep a recordset open, this may be the case. But you only need to open a connection to the database, and then run SQL queries through that. This takes much less RAM.
Oct 1 '07 #3
but I need to check my database every single second.
Oct 1 '07 #4
why does the anti virus doesn't consume lot of memory even its active?
Oct 1 '07 #5
that's what i wanted to do. the looping is active but it doesn't consume a lot of memory.
Oct 1 '07 #6
hariharanmca
1,977 1GB
but I need to check my database every single second.
Can you explain why you want to cehck every second?
Oct 1 '07 #7
because of process flag. it's active and i need to check it..
Oct 1 '07 #8
QVeen72
1,445 Expert 1GB
Hi,

What backend db are you using, and what do you need to check in the table?
If using Oracle/SQL Server/MySQL then, write trigger for each table for : "Insert".
Checking from Frontend, each table may consume lots of resources, Triggers will not consume much. Do the checking inside the trigger itself..

REgards
Veena
Oct 1 '07 #9
i'm using visual fox pro 6.0 free table.
Oct 1 '07 #10
QVeen72
1,445 Expert 1GB
Hi,

BTW, What checking do you need to do for each table/record?

Regards
Veena
Oct 1 '07 #11
for example every time that my process flag was changed into 2 then i need to change it to 3. i can't afford to lose a second because were in a fast phase processing.
Oct 1 '07 #12
hariharanmca
1,977 1GB
for example every time that my process flag was changed into 2 then i need to change it to 3. i can't afford to lose a second because were in a fast phase processing.
You know wnereever you are changing the process flag there you make an update process. Why you are doing each and every second. That will slowdown your process.
Oct 1 '07 #13
QVeen72
1,445 Expert 1GB
Hi,

Where is the Process Flag..?
A Field in one table or in Many Tables..?

REgards
Veena
Oct 1 '07 #14
i'm not the one who's changing the data of my processflag its the other system that i created.
Oct 1 '07 #15
processflag came in a one table..
Oct 1 '07 #16
QVeen72
1,445 Expert 1GB
Hi,

Somehow, still not very convinced on what you are wanting to do.
Can you give the table structure for which you need to check? And what table/field you need to change/update?
Is the change always linear? Like if it changes to 2, you want to make it 3 (as you said in your earlier post)? 3 to 4 and so on. Or is there some other logic for that?
Explain the problem in detail..

Regards
Veena
Oct 1 '07 #17
hariharanmca
1,977 1GB
I know your system is an multi user system.
No problem, There also you are the one updating the flag (Look, the flag will not update itself! you have to update, like flage=1 etc..,)
So whereever you are giving flag= somthing there you have to do your process.
Oct 1 '07 #18
yes its a multi user system.
Oct 1 '07 #19
Is the change always linear? No.

I need to check and change the field processflag, for example the processflag is number 2 then I’ll change it to number 3 for the last update. The problem is the memory every time I use a loop it will consume a memory my system will runs 24hours a day.
Oct 1 '07 #20
hariharanmca
1,977 1GB
Can you post what you had tried.
Oct 1 '07 #21
Killer42
8,435 Expert 8TB
This thread is sure stretching out longer than I expected.

You should be able to just...
  • Create an ADO connection to your database.
  • Set up a timer to fire every second (or perhaps every half-second).
  • When it fires, do your database logic.
What's the problem?
Oct 1 '07 #22
it wont consume a lot of memory when i do that. because my system will runs 24hours a day...
Oct 2 '07 #23
cugone
20
it wont consume a lot of memory when i do that. because my system will runs 24hours a day...
Set it up as a Windows Service and it will run in the background.
Oct 5 '07 #24
Killer42
8,435 Expert 8TB
it wont consume a lot of memory when i do that. because my system will runs 24hours a day...
I'd say your best bet is to give it a shot, and see what happens. The term "a lot of memory" could mean anything. A few years ago, I had a machine which was fantastic, because it had a whole 4MB of RAM. Was that "a lot"? It sure was, at the time.

So how much is "a lot" for your situation? Like I said, give it a go and see.

I recently had an application which used about 1.2GB of RAM by opening some big ADO recordsets. When I got rid of the recordsets and started just running commands through the ADO connection, it reduced by something between 700 and 900MB. (The fact that it still uses hundreds of MB is unrelated - it has some enormous arrays).
Oct 5 '07 #25

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

Similar topics

43
by: Gremlin | last post by:
If you are not familiar with the halting problem, I will not go into it in detail but it states that it is impossible to write a program that can tell if a loop is infinite or not. This is a...
13
by: na1paj | last post by:
here's a simple linked list program. the DeleteNode function is producing an infinit loop i think, but i can't figure out where.. #include <stdio.h> typedef struct { char *str; //str is a...
13
by: Redduck | last post by:
Hello everyone. I am frustrated, I have written the simple program below for a class and I am having problems with the DO-WHILE loop. On the first run through the loop, everything works well, the...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
51
by: Tony Sinclair | last post by:
I'm just learning C#. I'm writing a program (using Visual C# 2005 on WinXP) to combine several files into one (HKSplit is a popular freeware program that does this, but it requires all input and...
10
by: Steven Woody | last post by:
i have a program which always run dead after one or two days, i think somewhere a piece of the code is suspicious of involving into a infinite loop. but for some reason, it is very hard to debug....
2
by: Mike | last post by:
Hi, I am new to C and having problems with the following program. Basically I am trying to read some files, loading data structures into memory for latter searching. I am trying to use structres...
1
by: sam | last post by:
hi all, i am writing some software to model polymerisation kinetics and have created a way of doing so which involves taking ever smaller slices of time to model until some sort of convergence...
0
by: ewankosayo | last post by:
I have a BIG Problem, I need to create a program that will loop 24x7 to check the database and it wouldn’t consume a lot of memory. My platform is vb6 or .net Any advise Please..
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.