How to stop or reduce the RAM usage as the Wpf Datagrid is Continuosly being updated by background Worker?

Hi,
I am developing a packet sniffer application, I am getting a packets from adapter and am updating the information in the Wpf Datagrid using a Background worker. it is a continuous process. So if run this application for hours, after 5 or 6 hours I am getting
a "Sytem.OutofMemoryException" as the RAM being full. Now my requirement is, the usage of RAM should have a some limit(suppose 750MB) for my application, once application reaches this, the usage of RAM should not increase and at the same time I should
not get "OutofmemoryException". I mean application should free cached memory of starting Rows of DataGrid, means I should not display the initial Rows and I should display the latest entries. how can I achieve this?
thanks,
EDIT:
Here I am using DataGrid.Items.Add() method to add the entries into the datagrid.
How can I change my code to Observablecollection items now?

You could remove entries from the ItemsSource collection of the DataGrid once the number of items reaches a certain threshold of items.
If you for example use an ObservableCollection<T> as the ItemsSource of the DataGrid you could handle its CollectionChanged event and remove the oldest item when there are a total of say over 5000 (you may of course increase this value in your
partiuclar application of you require to be able to display more than 5000 items in the DataGrid) items in it. This will make sure that there will never by any more than 5000 items kept in memory:
const int MaxCount = 5000;
public MainWindow()
InitializeComponent();
ObservableCollection<string> collection = new ObservableCollection<string>();
collection.CollectionChanged += (ss, ee) =>
if (collection.Count > MaxCount)
collection.RemoveAt(0);
yourDataGrid.ItemsSource = collection;
Since there is no good way to determine exactly how much physical memory the objects in the ObservableCollection<T> occupy so you better choose a maximum
number of items to be kept in memory (like MaxCount = 5000 in the sample code above) and then remove the oldest one when the number of items reach this maximum.
Hope that helps.
Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

Similar Messages

  • So I have a (PC) laptop with 8gb of RAM and I'm running CC on it. I haven't set it up on this before so I'm wondering how much should I set the RAM usage to in performance so I can use it but not ruin this laptop?

    I just don't know where specifically to put the RAM at in the preferences option.
    I mainly use it for digital painting and sketching on this. (not so much painting on this but digital art)

    8 GB is about the realistic minimum for Photoshop nowadays.
    Set it to about 70% and go for there.  Note that it represents a maximum percentage of your momentarily available RAM after the OS and other running application have grabbed what they need., not a percentage of total installed RAM.  It changes continually.
    The rule of thumb I follow to figure out scratch space says to figure on 50 to 100 times the size of your largest file ever multiplied by the number of files you have open.  I have seen the scratch file exceed 800 GB once, an admittedly rare occurrence, but it often exceeds 200 GB when stitching large panoramas and the like.
    As an example—and stressing that I'm aware that others have even more scratch space than I do—I keep two dedicated, physically separate hard drives as my primary and secondary Photoshop scratch disks and a lot of GB free on my boot drive for the OS.  I also have 16 GB of RAM installed.
    Additionally, if you only have a single HD, i.e. your boot drive, you'd need it to be large enough to accommodate both the swap files of the OS as well as Photoshop's scratch.

  • When I try to open large files that i have created (1.2 gb to 1.5 gb) the ram usage for Photoshop climbs to 4 gb and the file will not open.

    I am using PS 12.1 x64 on a Windows 7 64 bit pc.when I try to open large files that i have created (1.2 gb to 1.5 gb) the ram usage for Photoshop climbs to 4 gb and the file will not open

    Machine specs, please.  Totallinstalled RAM, scratch disk space, etc
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand, such as your platform (Mac or Win), exact versions of your OS, of Photoshop and of Bridge, machine specs, what troubleshooting steps you have taken so far, what error message(s) you receive, if having issues opening raw files also the exact camera make and model that generated them, etc., someone may be able to help you.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Reg: How to Stop Polling of JDBC Adapter without Scheduling the adapter

    Dear Gurus,
    Here I am having one requirement. My clients wants to send data from JDBC adapter (ORcale System table) to R3 system via RFC.
    His Requirement::
    1. He is not telling the time of data flow from Oracle server so that based on that we can schedule the adapter in the Communication Channel monitoring (Availablitiy Time Planning) or Else we can Schedule by deciding the setting of the polling interval time.
    2. He is telling that When ever he waants to send the data he will place one dummy file in the File Adapter FTP location so that it will became an Indication for u to poll the jdbc adapter and to transfer the data to R3.
    3. Untill he keeps the file or gives indication he doesn;t want to communicate with Oracle server due to some security and it s a most important data base he doesn't want to disturb that Oracle Server as so many business are running  on that.....
    We Proposed::
    1. Atleast you need to tell the scheduling time or poll interval time so that we can schedule our adapter.
    but he s not accepting for this
    2. Atleast U need to give access for Data base to enter one more extra field like STATUS CODE so that we will add one number and we keep on Update in the Update table and based on that Update table statement it will poll.
    but he s not even accepting for this
    3. Finally we prposed that to create another table in the Oracle SYstem as Dulplicate Table which is similar to Standard Orginal table when ever he wants to pick the data please keep that data in this Duplicate TABle so that JDBC adapter will pick the data from thsi TABLE instead of picking the data from that standard table so that it will not effect any standard table data in the table.
    but he s not even accepting for this
    We have done some R & D:::
    1. WE approached even through BPM and via switch conditions is one scenario
       FILE RECEIVE >SWITCH CONDITION> RECEIVE AND SEND or else EXIT
    2. Using correlation in anotehr scenario means correlating File adapter and JDBC and based on one dynamica value it will goes to SEND STEP ( RECE IVE --> RECEIVE --> SEND STEPS )
    Even though we know this...concept that...we jsut tried::
    In BPM we can control the flow in XI 3.0 but we cannot Stop the Polling of JDBC adapter at backend because one the data comes from FILE adapter it will keep on HOLD untill it receives the JDBC from Oracle then based on the condition or Correlation it will goes futher SEND step means after that file adapter is picking file or not ...what ever it may be JDBC will polls at backend and brings that data to BPM"
    Hence sugest me How to Stop Polling of JDBC Adapter without Scheduling the adapter or else using STATUS CODE Update statements in JDBC Tables 
    Regards:
    Amar Srinivas Eli

    Hi! All,
    Finally I decided to do the scenario in two steps:
    1: FILE REQ --> JDBC REQ -->JDBC RES --> FILE RECV
    2: FILE RECV --> RFC
    But I am getting issue while doing first scenario
    Desgn :
    I have created 2 Synchronous interfaces :
    1) FILE 2 JDBC REQ
    In this a) out put message is FILE  Req
              b) Input msage:; FILE RES
    2} JDBC2FILE RECV
            a) Output mesage;; JDBC REQ
            b) Input Msge :: JDBC Response
    Mappings:
    1) File REQ-->JDBC REQ
    2) JDBC RES-->FILE RES
    Interface mappings:
    1: FILE 2 JDBC REQ--> JDBC 2 FLE RECV
    CONFIGURATION ::
    1: One Seder File CC
    2: Two reciever CC's one is for JDBC RECEIVER and other s FILE RECEIVER
    3; One Sender Agreement
    4: 2 Recver agreements
    5: One Interface Determination and
    6: One RECCV Determination
    My Question;;
    1. First let confirm whether my development steps are right or not ?
    2: Another thing s I am not sure reg Configuration Steps means
    whetehr one interface determination and one Receiver Determinations are required or not as these are synchronous Interfaces
    3: main Issue is::::
    If my scenario s FILE2RFC2FILE then I will get RFC response automatically but here issue is this is JDBC
    My reqquirement is By sending one Field from fILE to JDBC REQ it needs to send entire TAbLE records as a Response to file as XML
    without having Sender JDBC how can I send the JDBC Res to FILE and If that is the case then again JDBC adapter is polling which is contradict to the client requuirement which i explained above.
    pleas suggest me the Detailed steps mainly Colloboration agreements and logical routings and
    also explain in detail if i can  go for BPM
    Also give cleear blogs but before giving make sure that it contains detailed screen shots because aIready gone thorugh
    Scenario File-JDBC-RFC
    File<-->JDBC Sync coomunication.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/file-rfc-file(Without+BPM)
    /people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
    Regards::
    Amar Srinivas Eli

  • How to stop transform panel add stroke value to the shape I created

    Good morning,
    Does anyone know how to stop Transform panel in Illustrator CC adding the value of the stroke to the size please.

    In Preferences (Cmd[Ctrl}-K) uncheck Use Preview Bounds.

  • Find the tablespace usage for the last 6 months time.

    I have an Oracle 9i database. Now, there is a requirement to find the tablespace usage for the last 6 months.
    Can anyone please tell me, how can I achieve this? I do not have EM configured. So please lemme know if there is any script that can give these details?
    Thanks.

    878226 wrote:
    I have an Oracle 9i database. Now, there is a requirement to find the tablespace usage for the last 6 months.
    Can anyone please tell me, how can I achieve this? I do not have EM configured. So please lemme know if there is any s?cript that can give these details?
    Thanks.refer the link:- http://www.dba-oracle.com/t_v_datafile_database_size.htm
    note: i did not check the query and version. please check whether it is applicable to 9i database or not?
    10g and above refer:http://maxwellmiranda.wordpress.com/2011/03/22/segmenttablespace-growth-details-script/
    Edited by: rajeysh on Aug 28, 2011 12:14 PM

  • From the RAM limit to the CORE limit...

    I was thinking that Bidule (Plogue) is a good way to expand RAM Logic limit, but at the end it definetely shrinks to to be a way to add 2 or max 3 instruments to Logic possibilities (because of Rewire one core limit). If I use an Ivory and an Omnisphere plug I already get the Rewire core meter of Logic going near the top
    (I have a 2x3 Intel Xeon Quad Core)
    So, from the RAM limit to the CORE limit.....
    And I think also that the hard criticised Spectrasonics Atmosphere and Trilogy plugins wrappers, now reveal very very useful for saving my Logic RAM expansion possibilities...
    And about Logic 9..nothing mentioned on 64 bit support....

    If file size is the biggest concern, once you've cleared out
    all items
    you don't need any longer, try:
    1. Doing a Save As, then a Save As again. Often, for whatever
    reason,
    this finally gets rid of old, unused objects.
    2. Create a new project and import the existing project's
    slides. This
    can have the same effect.
    In my experience, the first is better for reducing file sizes
    and the
    second is better for getting rid of any playback anomalies.
    Otherwise, a better approach for what you're doing, again in
    my
    experience, would be to cut up the audio outside of Captivate
    into one
    file per slide (using a tool like Audacity), import them all
    into the
    library, then add each individually. That's our standard
    process and
    we've yet to experience these huge, bloated CP files (knock,
    knock).
    Erik
    luke@nesc wrote:
    > I have been using Captivate to imbed an audio recording
    of a presentation into
    > the slides for said presentation. The audio is in the
    form of one large mp3
    > file. When adding the audio, I select the option to
    distribute over many files,
    > and line up all the slides to the correct part of the
    audio. If i need to edit
    > the slide times or audio (this happens frequently
    because captivate seems to be
    > rather buggy when splitting up the single audio track
    into one for each slide)
    > the resulting Captivate Project file rockets in file
    size. ....
    Erik Lord
    http://www.capemedia.net
    Adobe Community Expert - Authorware
    http://www.adobe.com/communities/experts/
    http://www.awaretips.net -
    samples, tips, products, faqs, and links!
    *Search the A'ware newsgroup archives*
    http://groups.google.com/group/macromedia.authorware

  • Comparing the BOM usage with the actual usage for materials.

    Hi All
    My client want to compare the BOM usage with the actual usage and have a report for this within a period? More specified they want to calculate the BOM usage, based on the requirement quantity from confirmation - but with out the scrap %. mulitplied with the confimed quantity of the header material.
    The actual usage should be based on  goods issuing from stock, either as goods issue to order (backflushing) or as goods issue to cost center. 
    I havent been able to indentiy a standard report for doing this - does some of you know a standard report?
    -  I was thinking of the following method:
    Look at  tabel RESB and compare it  with MSEG, but I have some diferent problems with this.
      - In resb there is no qty before scrap. 
      - The data amount from MSEG, is so huge so it is not possible to make a data search for a whole period (eg. month)
    Br. M

    There is one std report MCRX which gives a comparison of quanity in order and actual consumption,
    if it doesnt meet your need, you may have to create a custom report.
    logic can be find the quantites as per BOM for the produced quantities
    issued quantities to the order
    tables you may need are AUFK AUFM
    AFKO, STAS STPO
    MSEG, MKPO
    JEST ( if you want to filter using order status)

  • Is it possible to upgrade the graphics card on a mid 2012 MacBook Pro? And is it possible to upgrade the RAM without voiding the warranty?

    Hi I was wondering if it is possible to upgrade the graphics card on a MacBook Pro and the RAM without voiding the warranty? I have a gt 650m in my MacBook Pro, non retina, and to me, its not enough power for me, so i was looking around, and I found a retailer that would give me a nvidia gtx 660m for a decent price. Also, the ram needs to be at least 12gbs, to ensure that my computer would run fast.
    If you can help, please tell me,
    Thankyou.

    No, the video card cannot be exchanged - you have a pretty decent GPU there; not sure why you'd want to switch it out. You can upgrade the RAM to a maximum of 16GBs. Apple recommends upgrading in matching pairs, so I don't really think I'd try 4GB and 8GB stick.
    Both Crucial and OWC have memory available for the new Macs. Both are reputable dealers and know Macs well and I would only buy from these sources (and I would buy Crucial, were it me).
    Although your Mac didn't come with a users manual outlining the installation of the additional RAM, you can download the late 2011 model users guide as the models themselves are almost identical.
    Good luck - write back with any questions.
    Clinton

  • 13" late 2011 MacBook Pro has frozen after Yosemite installation. I can, however, boot from a clone of my MacBook Air that is on an external drive. Despite the fact that I can boot from the external, could it be the RAM that's the prob

    My daughter's 13" late 2011 MacBook Pro has frozen (null sign displays) after Yosemite installation. I can, however, boot from a clone of my MacBook Air that is on an external drive. I reinstalled Yosemite on the MBP HD, but it still hangs in mid install. Despite the fact that I can boot from the external, could it be the RAM that's the problem? I'd happily put 8 GB in if it seems probable that would solve the problem. I've tried all the suggested procedures that I've seen posted here. Disk Utility, and my older version of DiskWarrior indicate the HD is OK. I have DiskWarrior 5 on order.

    Boot the MBP with the OPTION key down.  If successful, you should see two HDD icons,  Select the recovery partition (on the right).
    From the 4 option menu select Disk Utility.
    Run Disk Utility>First Aid, Verify and Repair.
    If the disk cannot be repaired, it will have to be replaced.
    Ciao.

  • After closing large documents (drawings) the window closes but the process runs still in the background. I open the next document, the same procedure and after dowing this several times the RAM is full the system becoms very slow. what can i do???

    after closing large documents (drawings) the window closes but the process runs still in the background. I open the next document, the same procedure and after dowing this several times the RAM is full the system becoms very slow. what can i do???

    You can always shut it down manually via the Task Manager
    (CtrlShiftEsc)...
    On Mon, Sep 1, 2014 at 3:05 PM, frank koethen <[email protected]>

  • How do I keep track of data usage on the iPhone 5C?

    I just purchased an iPhone 5C (my first smartphone), and I'm confused as to what exactly the GB information in the "Usage" menu under Settings-->General-->Usage means. Are those gigs that are listed how much I have used and available for storage ONLY, or does it also include LTE data usage? I just synced my phone with my iTunes library on my computer, and my "GB used" jumped from 1.0 to 6.3 GB. It seems to be under the heading "storage" and says I still have 7.0 GB available, so I'm inclined to think that it is only counting what I am actually storing on my phone, but if that is the case, then where can I check how much of my data for the month I have used? I am on a family plan, so I want to make sure I'm not accidentally driving our usage up. My Wifi connection at home is currently out, so I know I was using some LTE this morning, but I don't think it was very much. I figured out how to turn off LTE and 3G so I'm not accidentally using data now, but in any case, does anybody know where I can find my data usage info on my phone?
    Thanks!

    Under the Collection button you can add as many collections as you want. 
    I created one called "Reading".  I then move the book(s) I am reading into that collection so I can just go to there to find my current books.
    I also created one called "Complete" so I can remember which ones I can uncheck from iTunes. 

  • How can I find out my data usage for the past 3 months?

    Greetings all, I have been a long time Verizon customer, and as such I, along with my husband, was grandfathered into the unlimited data plan. When I last spoke to a representative, they informed me that the only way we were going to be able to keep our unlimited data was by paying the full retail price ($600+) to get a new phone. So we were considering upgrading and changing to one of the newer data plans so we could still get the discounted price on the new phone, but I would like to make sure I choose one with enough data, without paying for a bunch of data that I don't use, however MyVerizon only shows me the amount I have used since the start of the billing cycle. Is there a way to find out the data usage for both my husband and myself for the last 3 months so I can choose the right option?
    Thanks in advance for your help!

        Hello sweetpea1221! How exciting that you're considering upgrading with us. mrhelper is helpful, indeed. You can view your data usage for each line under the View Bill option via your My Verizon account. You can also view your 3 month average  data usage with our Account Analysis feature. Here's a link that will be helpful in doing so http://bit.ly/vnLjqO. I'm confident that we have a great plan to match your data needs. Please let us know if you have further questions.
    TanishaS1_VZW
    Follow us on Twitter @VZWSupport

  • How do i make the ram preview render the whole thing not just part of it

    i have a super-fast modern desktop computer so ram isn't an issue. i want the green bar to cover the whole thing, not leave gray and blue spaces.
    unrelated but while i'm here: is there a way to increase just the gamma of just the in-program composition window since i like to keep my monitor dark for my eyes but always have to increase brightness when watching movies as a result.
    also is there a way to increase the text size of the ui besides increasing the text size for the whole windows 8.1?

    How much RAM does your super-fast modern desktop have? AND what is the size of your composition?
    If you're getting spaces between the green bar, your RAM Preview options may include skip frames.
    If you don't have enough RAM to cache a large (or long) video, you can lower the resolution that you're attempting to RAM Preview (in your comp window if you're using Auto, or in the RAM Preview options).  Unfortunately, it means that you'll be trading quality of the video playback for duration of frames played.
    You can adjust the exposure of the video in the comp or footage windows by using the Exposure Button
    Turn up the value to over/under expose the video, but it won't change the RENDER, just the way you look at it in the window.
    You can toggle the icon on/off if you have a certain value you like to keep it set to.
    Exposure Button & Value

  • How to Stop Certain Users from Logging in to The Wiki?

    While the Wiki Server in Mountain Lion Server allows me to restrict who can create new wikis, it does not seem to allow me to restrict who can login. If I setup a 'Test User', and give this user access only to the FTP service on the server, this user can still use his credentials to login to the Wiki. In fact, every user that is listed on server - for any service - can login.
    Once logged in, even if the user has been prohibited to create new wikis, they seem to still be given a 'my documents' space on the wiki server, in which they can create pages, and where they can still upload files.
    There are, therefore, several users that I don't want to be able to login to the wiki, at all. Can wiki login access be restricted?

    Try:
    1) create users and uncheck access to all services for each user,
    2) create a group with access to File Sharing and FTP,
    3) edit the group to add users, then
    4) Create Group Wiki
    Does that get you closer to the behavior you seek? Users will still see the main Wiki page, but won't have access to any of the individual wikis unless they're a member of that group's Wiki.

Maybe you are looking for