Garbage collector help.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • trialproduct2004@yahoo.com

    Garbage collector help.

    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.

  • Willy Denoyette [MVP]

    #2
    Re: Garbage collector help.

    See inline

    Willy.

    <trialproduct20 04@yahoo.com> wrote in message
    news:1132572147 .171109.161020@ o13g2000cwo.goo glegroups.com.. .[color=blue]
    > 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.
    >[/color]

    How large?? how many rows in the tables size of the rows etc..
    [color=blue]
    > 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.
    >[/color]

    Same question: see above.
    [color=blue]
    > 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.
    >[/color]

    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.
    [color=blue]
    > 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.
    >[/color]

    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!!!.
    [color=blue]
    > can some one help me why this is happening and exact role of garbage
    > collector in this case.
    >[/color]

    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.
    [color=blue]
    >
    > Please help me as i am completely stuck on this.
    >
    > thanks in advance.
    >[/color]


    Comment

    • Ignacio Machin \( .NET/ C# MVP \)

      #3
      Re: Garbage collector help.

      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,

      --
      Ignacio Machin,
      ignacio.machin AT dot.state.fl.us
      Florida Department Of Transportation


      <trialproduct20 04@yahoo.com> wrote in message
      news:1132572147 .171109.161020@ o13g2000cwo.goo glegroups.com.. .[color=blue]
      > 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.
      >[/color]


      Comment

      Working...