Garbage collector help.

  • Thread starter Thread starter Willy Denoyette [MVP]
  • Start date Start date
W

Willy Denoyette [MVP]

See inline

Willy.

Hi all

i am having two application which are using database connectivity.

In both the application i am filling one large table of database into
dataset.

How large?? how many rows in the tables size of the rows etc..
When i run first application it will fill table into dataset and
display me proper count of rows.

Now i started second application, where again i am filling dataset.

Same question: see above.
When i run second appication, i noticed that to get memory for second
application memoy of first application is releasing which i don't want.

What i want is if forsecond application memoyr is not available it
shold not release memory of first application because it will cause
major problem for me.

Well don't run the second application then, there is nothing you can do
about it else than adding memory to your system or reduce your memory needs.
Because on first application after some time i want to use rows of
that dataset which is not possible if i run second app.

First app will start giving me error 'object reference not set'. means
after running second app, the dataset of first app becoming null whihc
i don't want.

This smell like a bug, running both at the same time can only slow down the
whole system when there is lack of memory but your managed objects (for
both) should remain valid/accessible albeit SLOW!!!.
can some one help me why this is happening and exact role of garbage
collector in this case.

The GC has nothing to do with this (see my reply on one of your other
postings), you seems to forget that memory is a shared (and scarse)
resource, you should handle it with care and watch your consumption. Dataset
have a large overhead, just like Datatables you should consider this in your
design.
 
Hi all

i am having two application which are using database connectivity.

In both the application i am filling one large table of database into
dataset.

When i run first application it will fill table into dataset and
display me proper count of rows.

Now i started second application, where again i am filling dataset.

When i run second appication, i noticed that to get memory for second
application memoy of first application is releasing which i don't want.

What i want is if forsecond application memoyr is not available it
shold not release memory of first application because it will cause
major problem for me.

Because on first application after some time i want to use rows of
that dataset which is not possible if i run second app.

First app will start giving me error 'object reference not set'. means
after running second app, the dataset of first app becoming null whihc
i don't want.

can some one help me why this is happening and exact role of garbage
collector in this case.


Please help me as i am completely stuck on this.

thanks in advance.
 
Hi,

I think you have a simple bug, you are calling a method or property of an
instance without instantiate it first.

How big is your dataset? if too big then it would be better to just read
chunk of it. if for some reason you need all of it in memory you could
create a web service that will host the data ( and methods ) and will be
shared by both apps.




cheers,
 
Back
Top