472,809 Members | 4,506 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,809 software developers and data experts.

Application performance decrease after deleting rows

Hi, thank you for your help.
My VB.Net application contains a document that the user can refresh at any
time.
The refresh works fine and needs to loop through few datatables (hundreds of
rows). This works fine until I delete some rows in two tables. Just after the
delete if I do the refresh there is a huge memory allocated and the time
needed to perform the refresh increase, the memory and time continue to
increase on each refresh until I save and force garbage collector, after the
GC the memory return to its normal size. I cheked using analysis tool and the
rows that allocated huge memory are 'select' commands and I have no idea how
to solve this problem (the only choice I have is to save and force GC). My
dataset contains only about 20 datatables and few hundreds of rows. I guess
there is a problem with the select after the delete it seems allocating huge
memory.
Thanks
Nov 13 '06 #1
8 1810
Nadir,

Every time there are a lot of messages about the taskmanager showing a hugh
amount of memory.

Be aware that the taskmanager is not correct giving memory, while on the
other hand there is no need to be afraid as there is still enough memory.

If you really want to investigate this for whatever reason, than use other
tools. If you search the newsgroup dotnet general for that you find tons of
messages about this.

Cor

"NAdir" <NA***@discussions.microsoft.comschreef in bericht
news:C4**********************************@microsof t.com...
Hi, thank you for your help.
My VB.Net application contains a document that the user can refresh at any
time.
The refresh works fine and needs to loop through few datatables (hundreds
of
rows). This works fine until I delete some rows in two tables. Just after
the
delete if I do the refresh there is a huge memory allocated and the time
needed to perform the refresh increase, the memory and time continue to
increase on each refresh until I save and force garbage collector, after
the
GC the memory return to its normal size. I cheked using analysis tool and
the
rows that allocated huge memory are 'select' commands and I have no idea
how
to solve this problem (the only choice I have is to save and force GC). My
dataset contains only about 20 datatables and few hundreds of rows. I
guess
there is a problem with the select after the delete it seems allocating
huge
memory.
Thanks

Nov 14 '06 #2
On Nov 14, 5:53 am, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
Nadir,

Every time there are a lot of messages about the taskmanager showing a hugh
amount of memory.

Be aware that the taskmanager is not correct giving memory, while on the
other hand there is no need to be afraid as there is still enough memory.

If you really want to investigate this for whatever reason, than use other
tools. If you search the newsgroup dotnet general for that you find tons of
messages about this.
Cor, explain why you think task manager does not correctly report
memory usage. If you compare it to perfmon you'll see that it does.
Perhaps the problem is that you do not know how to interpret the
information displayed.

Nov 14 '06 #3
or the question asked ...

the OP asked for possible solutions as to why the delete causes lags and
increased memory usage when using a refresh ... not does the task manager
report accurately ... and as far as I know ... the task managers works just
fine for this!.
"Hugh Janus" <my*************@hotmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
On Nov 14, 5:53 am, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
>Nadir,

Every time there are a lot of messages about the taskmanager showing a
hugh
amount of memory.

Be aware that the taskmanager is not correct giving memory, while on the
other hand there is no need to be afraid as there is still enough memory.

If you really want to investigate this for whatever reason, than use
other
tools. If you search the newsgroup dotnet general for that you find tons
of
messages about this.

Cor, explain why you think task manager does not correctly report
memory usage. If you compare it to perfmon you'll see that it does.
Perhaps the problem is that you do not know how to interpret the
information displayed.

Nov 14 '06 #4
There is a huge memory allocated after deleting rows and executing select
command, this is not normal because not only memory increase in subsequent
refreshs but also the execution time increase. I checked with dev partner
studio and found that I need to save my document (including the data set)
then execute a GC.collect, this will bring the memory to its normal size.
Executing CG.collect without prior save does not free memory. I suspect
something with ADO .NET commands (what happens after executing delete rows
then select).

"jeff" wrote:
or the question asked ...

the OP asked for possible solutions as to why the delete causes lags and
increased memory usage when using a refresh ... not does the task manager
report accurately ... and as far as I know ... the task managers works just
fine for this!.
"Hugh Janus" <my*************@hotmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
On Nov 14, 5:53 am, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
Nadir,

Every time there are a lot of messages about the taskmanager showing a
hugh
amount of memory.

Be aware that the taskmanager is not correct giving memory, while on the
other hand there is no need to be afraid as there is still enough memory.

If you really want to investigate this for whatever reason, than use
other
tools. If you search the newsgroup dotnet general for that you find tons
of
messages about this.
Cor, explain why you think task manager does not correctly report
memory usage. If you compare it to perfmon you'll see that it does.
Perhaps the problem is that you do not know how to interpret the
information displayed.


Nov 14 '06 #5
A pity Jeff, that it is a very known issue.

http://groups-beta.google.com/group/...rch+this+group

Cor

"jeff" <jhersey at allnorth dottt comschreef in bericht
news:O4**************@TK2MSFTNGP03.phx.gbl...
or the question asked ...

the OP asked for possible solutions as to why the delete causes lags and
increased memory usage when using a refresh ... not does the task manager
report accurately ... and as far as I know ... the task managers works
just fine for this!.
"Hugh Janus" <my*************@hotmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>On Nov 14, 5:53 am, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
>>Nadir,

Every time there are a lot of messages about the taskmanager showing a
hugh
amount of memory.

Be aware that the taskmanager is not correct giving memory, while on the
other hand there is no need to be afraid as there is still enough
memory.

If you really want to investigate this for whatever reason, than use
other
tools. If you search the newsgroup dotnet general for that you find tons
of
messages about this.

Cor, explain why you think task manager does not correctly report
memory usage. If you compare it to perfmon you'll see that it does.
Perhaps the problem is that you do not know how to interpret the
information displayed.


Nov 14 '06 #6
TP
You didn't mention which version of the framework you are
using. Check this article to see if it applies to you:

FIX: The DataTable.Select method leaks memory from the index
when you set some specific filter properties

http://support.microsoft.com/kb/814470

Please post your code so that we can see what you are doing.

Also, be aware that a datatable.select creates indexes as needed
on the fly, and in .NET 2.0 it discards them after the call completes.
If it needs to create indexes each time this will lead to slower
performance and increased memory pressure.

You may want to experiment with using a dataview instead.

Thanks.

-TP

NAdir wrote:
There is a huge memory allocated after deleting rows and executing
select command, this is not normal because not only memory increase
in subsequent refreshs but also the execution time increase. I
checked with dev partner studio and found that I need to save my
document (including the data set) then execute a GC.collect, this
will bring the memory to its normal size. Executing CG.collect
without prior save does not free memory. I suspect something with ADO
.NET commands (what happens after executing delete rows then select).

Nov 14 '06 #7
TP
Many of the past posts regarding the task manager can
be misleading. People could get the false impression
that task manager is "defective" or that the numbers it
shows are "meaningless".

It seems to me that things in the group have degraded to:

1. Person asks question regarding leak or possible
high memory use/performance problem

2. Knee-jerk response of "Are you looking at Task
Manager--forget that, it is wrong anyway. Besides,
today's machines have tons of RAM, who cares?"

This is not a good approach, because high memory
use and/or leaks can cause performance problems and
errors, even on machines with relatively large amounts
of RAM. It is important to remember that an app
may be used under terminal services, in which case
sloppy memory/resource use issues are multiplied.

Task manager displays a number of performance
counters in an easy to use format. It displays the correct
values of these performance counters, just as it did *long*
before the first .NET application existed.

What it doesn't show, and never has shown, is the amount
of memory sharing that is occuring, how much of allocated
memory has recently been touched by the process, the
minimum working set that each process requires to perform
well, how much of allocated memory is resident, etc.

Task manager can be very helpful in detecting substantial
memory leaks in .NET apps. For example, it is easy to
create a winforms app with a leak and then use taskman to
view an ever-increasing amount of private bytes (VM Size)
allocated. It is not helpful for very small leaks, for example,
4 bytes every once in a while.

I would strongly recommend that you and anyone else who
would like to understand memory management under windows
read chapter 7 of Windows Internals, by Mark Russinovich &
David Solomon:

http://www.amazon.com/Microsoft-Wind...dp/0735619174/

-TP

Cor Ligthert [MVP] wrote:
A pity Jeff, that it is a very known issue.

http://groups-beta.google.com/group/...rch+this+group

Cor
Nov 14 '06 #8
Thank you TP,
I could not publish my code because it is long and I use the select is
multiple
subroutines. Your suggestion about the problem with SELECT index maybe the
right problem. I was thinking about a problem with the SELECT OR DELETE
COMMANDS. I will experiement and publish the code. As I described in previous
post: using devPartner software, the test shown a problem with the select
after deleting datatable rows, the memory increase about 20 Mb and time of
executing next selects increases, only after executing accpet changes on the
dataset and GC.collect the memory and time become normal. Thanks again this
was a big issue for my application performance.

"TP" wrote:
Many of the past posts regarding the task manager can
be misleading. People could get the false impression
that task manager is "defective" or that the numbers it
shows are "meaningless".

It seems to me that things in the group have degraded to:

1. Person asks question regarding leak or possible
high memory use/performance problem

2. Knee-jerk response of "Are you looking at Task
Manager--forget that, it is wrong anyway. Besides,
today's machines have tons of RAM, who cares?"

This is not a good approach, because high memory
use and/or leaks can cause performance problems and
errors, even on machines with relatively large amounts
of RAM. It is important to remember that an app
may be used under terminal services, in which case
sloppy memory/resource use issues are multiplied.

Task manager displays a number of performance
counters in an easy to use format. It displays the correct
values of these performance counters, just as it did *long*
before the first .NET application existed.

What it doesn't show, and never has shown, is the amount
of memory sharing that is occuring, how much of allocated
memory has recently been touched by the process, the
minimum working set that each process requires to perform
well, how much of allocated memory is resident, etc.

Task manager can be very helpful in detecting substantial
memory leaks in .NET apps. For example, it is easy to
create a winforms app with a leak and then use taskman to
view an ever-increasing amount of private bytes (VM Size)
allocated. It is not helpful for very small leaks, for example,
4 bytes every once in a while.

I would strongly recommend that you and anyone else who
would like to understand memory management under windows
read chapter 7 of Windows Internals, by Mark Russinovich &
David Solomon:

http://www.amazon.com/Microsoft-Wind...dp/0735619174/

-TP

Cor Ligthert [MVP] wrote:
A pity Jeff, that it is a very known issue.

http://groups-beta.google.com/group/...rch+this+group

Cor

Nov 15 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rishi | last post by:
Looking for tips on how to improve performance on deleting records. In our database we do dataloads daily that require us to purge millions of records a day so any improvement in speed would be...
3
by: Joachim Klassen | last post by:
Hi all, first apologies if this question looks the same as another one I recently posted - its a different thing but for the same szenario:-). We are having performance problems when...
5
by: Gavin Scott | last post by:
Hi, I'm having a performance problem with a large database table we use with postgres 7.3.4. The table is: db=> \d log Table "public.log" Column | Type | Modifiers...
12
by: bernhard.willems | last post by:
We are using DB2 UDB version 8.1 fp7 & fp9 on AIX 5.2. On our databases we do massive inserts and deletes (millions of rows). The performance is dramatically reduced because of pseudo deleted keys....
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
7
by: P. Adhia | last post by:
Sorry for quoting an old post and probably I am reading out of context so my concern is unfounded. But I would appreciate if I can get someone or Serge to confirm. Also unlike the question asked in...
4
by: Cray | last post by:
Hello, On the database we have stored procedure that loads couple thousands rows with information, it has to be done sequentially because during this load various variables and values has to...
2
by: rAinDeEr | last post by:
Hi, I have a table with the following definition. The primary key is west_nme and west_eff_tms and i have created unique index on them. The foreign keys which reference other parent tables are...
5
by: psbasha | last post by:
Hi, Initially when I started programming with the basic functionality of the application,it was taking less time for the application to get executed ( say ~2 Min).Now as the functionality is...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.