Can I prevent XP from swapping out a program?

W

Warren Sirota

Hi,

I have a client who is running a program I've helped write (in VB, with a
handful of 3rd-party controls added). When he leaves his XP computer for 1/2
hour to 2 hours, weird things start happening to the application. The most
common thing is that when he clicks on a button on the main menu to bring up
another form, the form takes an inordinately long time to appear (normally
it takes about 2 seconds, but in these situations it can take over 30).
Another thing that has recently been observered is that if he minimizes the
program to the taskbar and comes back after 2 hours, he can't maximize it.

I know that the source code is not responsible for this - there is no
activity that is explicitly being generated during these idle times. There
is an open ADO connnection, so perhaps a timeout on that has something to do
with the problem. But I think it's probably XP memory management.

Does anyone have any suggestions for this? Can I mark the app as
unswappable? Are there other things I should try? Or do you think I'm
barking up the wrong tree?

Thanks for any help you might have.

Warren Sirota
(e-mail address removed)
 
S

Sash

Wrong tree I think.... XP has probably the best memory management out of all
the home OS's from Microsoft.

I know you don't think it is the code... but it could well be....... other
apps/games don't have this problem.

Might be worth while you kicking around some of the c++ forums...

Anyways

Sascha

--
Check out www.mp3.com/camelppa if you get bored

Thanks for listening - Feedback Welcome !

:cool:
 
J

Jim Macklin

Why not write a "refresh code" into your program so it stays
active, even when in the system tray.


| Hi,
|
| I have a client who is running a program I've helped write
(in VB, with a
| handful of 3rd-party controls added). When he leaves his
XP computer for 1/2
| hour to 2 hours, weird things start happening to the
application. The most
| common thing is that when he clicks on a button on the
main menu to bring up
| another form, the form takes an inordinately long time to
appear (normally
| it takes about 2 seconds, but in these situations it can
take over 30).
| Another thing that has recently been observered is that if
he minimizes the
| program to the taskbar and comes back after 2 hours, he
can't maximize it.
|
| I know that the source code is not responsible for this -
there is no
| activity that is explicitly being generated during these
idle times. There
| is an open ADO connnection, so perhaps a timeout on that
has something to do
| with the problem. But I think it's probably XP memory
management.
|
| Does anyone have any suggestions for this? Can I mark the
app as
| unswappable? Are there other things I should try? Or do
you think I'm
| barking up the wrong tree?
|
| Thanks for any help you might have.
|
| Warren Sirota
| (e-mail address removed)
|
|
 
W

Warren Sirota

Well, that's another weird thing. I put some refreshing code in there (a
periodic requery of a small database table, figuring that would keep the
connection alive), but it doesn't seem to work. I'm wondering whether I
actually have to touch the gui (like changing a form caption, or sending a
mouseclick to a form) for some weird reason... but this is seeming a bit
bizarre.
 
J

Jim Macklin

If you are willing to make your code public open-source you
might get some better help from
www.sourceforge.net


| Well, that's another weird thing. I put some refreshing
code in there (a
| periodic requery of a small database table, figuring that
would keep the
| connection alive), but it doesn't seem to work. I'm
wondering whether I
| actually have to touch the gui (like changing a form
caption, or sending a
| mouseclick to a form) for some weird reason... but this is
seeming a bit
| bizarre.
|
|
in message
| | > Why not write a "refresh code" into your program so it
stays
| > active, even when in the system tray.
| >
| >
| > | > | Hi,
| > |
| > | I have a client who is running a program I've helped
write
| > (in VB, with a
| > | handful of 3rd-party controls added). When he leaves
his
| > XP computer for 1/2
| > | hour to 2 hours, weird things start happening to the
| > application. The most
| > | common thing is that when he clicks on a button on the
| > main menu to bring up
| > | another form, the form takes an inordinately long time
to
| > appear (normally
| > | it takes about 2 seconds, but in these situations it
can
| > take over 30).
| > | Another thing that has recently been observered is
that if
| > he minimizes the
| > | program to the taskbar and comes back after 2 hours,
he
| > can't maximize it.
| > |
| > | I know that the source code is not responsible for
this -
| > there is no
| > | activity that is explicitly being generated during
these
| > idle times. There
| > | is an open ADO connnection, so perhaps a timeout on
that
| > has something to do
| > | with the problem. But I think it's probably XP memory
| > management.
| > |
| > | Does anyone have any suggestions for this? Can I mark
the
| > app as
| > | unswappable? Are there other things I should try? Or
do
| > you think I'm
| > | barking up the wrong tree?
| > |
| > | Thanks for any help you might have.
| > |
| > | Warren Sirota
| > | (e-mail address removed)
| > |
| > |
| >
| >
|
|
 
A

Alex Nichol

Warren said:
I know that the source code is not responsible for this - there is no
activity that is explicitly being generated during these idle times. There
is an open ADO connnection, so perhaps a timeout on that has something to do
with the problem. But I think it's probably XP memory management.

Does anyone have any suggestions for this? Can I mark the app as
unswappable? Are there other things I should try? Or do you think I'm
barking up the wrong tree?

If something is happening to memory management, it will be instigated by
the program. Find the cause, rather than stick a band aid on an
amputated limb.

Load up Task Manager (from a r-click in the task bar, or a Ctl-Alt-Del)
and use it to monitor the CPU and Memory usage by the program in the
Processes (you may need to add columns in its View - Columns). It may
be that you see it taking a steadily increasing amount of memory, even
when it is supposed to be quiescent. This would indicate that you have
some loop that is going around allocating virtual memory space through
MALLOC and never returning any. which is a programming fault
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top