Why this specific buffer Allocation?

Win Vista, LabVIEW 8.6.1, PXI 8196, LV RT 8.6.1

I have a problem with a PXI program used to control a motor/dynamometer by PID loops on a cycle prescribed thresholds (objectives specific speed/torque to meet).

The normal use of the processor (as the output of the PXI monitor shows) is normally 2%.  My loop is 100,000 Hz, and I have been diligent in spreading the bypass, so it runs very efficiently.

A 'normal' test was for 20 minutes, so we have never noticed a problem.  However, my client has recently published a test of 8 hours, and he noticed that the CPU would creep upward and upward during the test, to where it was 75% after 8 hours.

I ran my own test of 2 hours and observed the same thing - the CPU usage crept up to 20%.

In the hunt for things, I noticed it is correlated with the size of an array of values of the PXI controller: larger than array, the CPU usage more.  During the test, the set values are located above the host right in front of the time, so the table grows slowly as the test goes along.

When the test is finished, the table does not, and nor does the CPU usage.  I can go right through to start a new test and the CPU usage drops when I send an order to clear the table.  Therefore, I am sure that the size of the array is the problem.

A two hour test contains 120 x 60 x 10 = 72000 set points (the host set points are 10 Hz, 100 Hz setpoints are interpolated from the controller) to 24 bytes, which is 1.728 MB.  NOT a RAM huge hit (available from 2 gigabytes).

I couldn't imagine why the existence of this large table would be time-consuming CPU, but the evidence is with myself: the bigger picture, the most used CPU.

In the search for an answer, I started the buffer ALLOCATIONS view and found a place where LV makes a COPY of this buffer, and I don't understand why.

But that would explain things: copy a table from 1.7 MByte to 100 Hz will certainly put a load on the processor.

So here's the code: in the TRANSIENT state table is used to select and interpolate the next set.

When the test is finished, we go to the State of SLOWDOWN, if the table is not yet used:

After that, we are in idle state, where even once, the big Board is not used.

Then, before I have to change the architecture of things to eliminate former set points (I have many problems with accounting), can someone explain WHY the buffer allocation shown is happening?

Note that I show the case of '0', the other is 'default' which manages other 9 out of 10 cases.  But there is there again, a buffer allocation when the table is not yet connected to the inside.

More importantly, avoid this allowance?

It's hard to say without poking at him but I saw the similar models result in a copy of the additional buffer.

(1) (less likely) the wire branch off to feed the size of the table is confusing LV and he thinks he needs another copy. I saw this in all LV 7.1 and can not ask with LV 8.6.1.

(2) the sub - VI "to choose and interpolate the next set" has NO control on the connector of the icon on the "root" of the diagram and or data are not connected through. To understand what I'm upgrading to please see the "clear as mud" thread , where it was called Grg McKaskle out of retirement to explain how it can work Subvi in the buffer of the appellant (that's really what you want in the code you showed us).

Reader Digest Version:

When LV 'sees' data be passed to and from a Subvi and there is no operation that will change the content of the data, the data will be passed by reference so sub - VI will do its job in the buffer of appellants.

This image of code shows the difference.

Ben

PS "Buffer Allocation" in the hand catches my attention.

Tags: NI Software

Similar Questions

  • buffer allocation and minimizing memory allocation

    Hello

    I am tryint to minimize the buffer allocation and memory in general activity. The code will run 'headless' on a cRIO and our experience and that of the industry as a whole is to ellliminate or minimize any action of distribution and the dynamic memory deallocation.

    In our case we treat unfortunately many string manipulations, thus eliminating all the alloc/dealloc memmory is significant (impossible?).

    Which leaves me with the strategy of "minimize".

    I did some investigation and VI of profiling and play with the structure "on the spot" to see if I can help things.

    For example, I have a few places where I me transpoe a few 2D charts. . If I use the tool 'See the buffer allocations' attaced screenshot would indicate that I am not not to use the structure of the preliminary examination International, both for the operation of transposition of the table for the item index operations? As seems counter intuitive to me, I have a few basic missunderstanding either with the "show stamp" tool of the preliminary examination International, or both... The tool shows what a buffer is allocated in the IPE and will once again out of the International preliminary examination, and the 2D table converts has an allowance in and out, even within the IPE causing twice as many allowances as do not use REI.

    As for indexing, using REI seems to result in 1.5 times more allowances (not to mention the fact that I have to wire the index numbers individually vs let LabVIEW auto-index of 0 on the no - IPE version).

    The example illustrates string conversions (not good from the point of view mem alloc/dealloc because LabVIEW does not determine easily the length of the 'picture' of the chain), but I have other articles of the code who do a lot of the same type of stuff, but keeping digital throughout.

    I would be grateful if someone could help me understand why REI seems to increase rather than decrease memory activity.

    (PS > the 2D array is used in the 'incoming' orientation by the rest of the code, so build in data table to avoid the conversion does not seem useful either.)

    QFang wrote:

    -My reasoning (even if it was wrong) was to indicate to the compiler that "I do not have an extra copy of these tables, I'll just subscribe to certain values..." Because a fork in a thread is a fairly simple way to increase the chances of duplications of data, I thought that the function index REI, by nature to eliminate the need to split or fork, the wire of the array (there an in and an exit), I would avoid duplication of work or have a better chance to avoid duplication of work.

    It is important to realize that buffer allocations do occur at the level of the nodes, not on the wires. Although it may seem to turn a thread makes a copy of the data, this is not the case. As the fork will result in incrementing a reference count. LabVIEW is copy-on-write - no copy made memory until the data is changed in fact, and even in this case, the copy is performed only if we need to keep the original. If you fork a table to several functions of Board index, there is always only one copy of the table. In addition, the LabVIEW compiler tries to plan operations to avoid copies, so if several branches read from a wire, but only it changes, the compiler tries to schedule the change operation to run after all the readings are made.

    QFang wrote:

    After looking at several more cases (as I write this post), I can't find any operation using a table that I do in my code that reduces blackheads by including a preliminary International examination... As such, I must STILL understand IPE properly, because my conclusion at the present time, is that haver you 'never' in them for use. Replace a subset of a table? no need to use them (in my code). The indexing of the elements? No problem. .

    A preliminary International examination is useful to replace a subset of the table when you're operating on a subset of the original array. You remove the items that you want, make some calculations and then put back them in the same place in the table. If the new table subset comes from somewhere other than the original array, then the POI does not help. If the sides of entry and exit of International preliminary examination log between them, so there no advantage in PEI.

    I am attaching a picture of code I wrote recently that uses the IPEs with buffer allocations indicated. You can see that there is only one game of allowances of buffer after the Split 1 table D. I could have worked around this but the way I wrote it seemed easier and the berries are small and is not time-critical code so there is no need of any optimization. These tables is always the same size, it should be able to reuse the same allowance with each iteration of the VI, rather than allocate new arrays.

    Another important point: pads can be reused. You might see a dot of distribution on a shift register, but that the shift register must be assigned only once, during the first call to the VI. Every following call to the VI reuses this very spot. Sometimes you do not see an allocation of buffer even if it happens effectively. Resizing a table might require copying the whole table to a new larger location, and even if LabVIEW must allocate more memory for it, you won't always a point of buffer allocation. I think it's because it is technically reassign an existing table instead of allocating a new, but it's always puzzled me a bit. On the subject of the paintings, there are also moments where you see a point to buffer allocation, but all that is allocated is a 'subfield' - a pointer to a specific part of an existing table, not a new copy of the data. For example 1 reverse D table can create a sub-table that points towards the end of the original with a 'stride' array-1, which means that it allows to browse the transom. Same thing with the subset of the table. You can see these subtables turning on context-sensitive help and by placing the cursor on a wire wearing one, as shown in this image.

    Unfortunately, it isn't that you can do on the string allocations. Fortunately, I never saw that as a problem, and I've had systems to operate continuously for months who used ropes on limited hardware (Compact FieldPoint controllers) for two recordings on the disk and TCP communication. I recommend you move the string outside critical areas and separate loop operations. For example, I put my TCP communication in a separate loop that also analyses the incoming strings in specific data, which are then sent by the queue (or RT-FIFO) to urgent loops so that these loops only address data of fixed size. Same idea with logging - make all string conversions and way of handling in a separate loop.

  • LabVIEW 2015 Buffer Allocation Bug?

    This happens in LabVIEW 2015 SP1 32 bit running on 64 bit, Win 7; It does not appear to occur in 2014 of LabVIEW.

    Look at the screenshot, the Subvi is a simple in and out with no operation.

    In the preliminary examination International one copy buffer product (red circle), but not in other cases. Does anyone have an idea why this is the case? I would like to use the structure of the International preliminary examination to select a subset of data to operate on, so the other case does not apply.

    The screws are attached in the zip file.

    See you soon,.

    McDuff

    If you inline the Subvi, allowance disappears.

  • Entered Unwired error cause buffer allocation

    Recently, while playing 'Hide the Dots', have I noticed that wiring not not admission of error on the functions (such as the authors of the notifications, queues or nodes of property) may be coming to a bill of costs.

    If a cluster of error is X bytes and you have dozens of these unwired (let) laying around, declaring it is buffer allocation [X bytes * notifiers n]? Correct me if I'm wrong, but the old saying no error output?

    Edit: I know that is not the wiring error may cause a race condition, the non-LabVIEW-esque program sequence, etc, but I would like to talk about the aspect of memory of this alone.

    Hi all

    As the 'error' is only a recommended terminal, when he is not wired LabVIEW must locate and assign default values for this entry. To do this, a memory to be allocated. Therefore, not wiring error as well as the terminals not required tickets will actually increase the initial memory allocation. However, this additional allocation should be minimal compared to the rest of your VI.

  • After the installation of Sierra, websites follow me like crazy!  This has not happened before.  Why this is happening and what can I do to stop it?

    After the installation of Sierra, Web sites started to follow me like crazy!  This has not happened before.  Why this is happening and what can I do to stop it?

    What are your privacy settings in Safari preferences.

  • My Airport Express will randomly start flashing orange and I have to unplug it to make it back to the green.  Wifi continues to operate even when the light is orange flashing.  Anyone know why this is happening?

    My Airport Express will randomly start flashing orange and I have to unplug it to make it back to the green. Wifi continues to operate even when the light is orange flashing. Anyone know why this is happening?

    The next time you see the flashing light amber...

    Open Finder > Applications > utilities > AirPort Utility

    Click on the image of the AirPort Express

    If you see a button update, click on update the firmware on the airport

    Otherwise, find status and click on the little orange dot it. A message will appear to say why the airport complained and suggest a remedy for the issue.

  • Why this message: you are not allowed to view or update this topic

    Why this message: you are not allowed to publish or comment on it.

    It's a legitimate question.

    You encounter a bug in the Jive Software that runs this forum. Most of the time simply try again or refresh the page will fix the problem. There is one caveat with respect to time. You can't post more than once every 30 seconds, and it's to discourage spamming.

  • don't get open email addresses do not message, then possibly the email opens; Why this took place over the 2 or 3 days?

    During 2-3 days when I try to open an e-mail or delete an email I get "not responding" after 30 seconds or so him "unresponsive" goes then and I can open the e-mail or delete it. Why this is happening now and how can I fix it? It is very annoying to have to wait to read or delete an e-mail. I compact the file whenever the message appears on my screen.

    https://wiki.Mozilla.org/Thunderbird: test: Antivirus_Related_Performance_Issues #McAfee

  • Why firefox free version 29.0.1. It's terrible! I had to find a plugin to change the back legs. Bad decision. Why this was done?

    Why firefox free version 29.0.1. It's terrible! I had to find a plugin to change the back legs. Bad decision. Why this was done?
    Not happy with the version 29.0.1 - are there plans for this move?

    Hi RickAce

    Could you please start a new thread for your question?

    You can provide more information such as your operating system and installed extensions and plugins installed.

    In case of accidents also please add a few recent crash ID that you can find on the subject: page hangs and which begin with a prefix 'bp '.

    You can check for problems with the files that store the preferences.

    Delete a possible user.js file and files numbered prefs-# .js and rename (or delete) the file prefs.js to reset all the prefs by default, including the prefs set via user.js and pref which is no longer supported in the current version of Firefox.

  • I can't see the images received by using my Yahoo email in my MacBook Air, but I can see them in my iPhone 6, no idea why this is happening?

    I can't see the images received by using my Yahoo email in my MacBook Air, but I can see them in my iPhone 6, no idea why this is happening?

    Hello

    If you access your Yahoo mail via Mac Mail application, in the Mail menu bar, click Mail > Preferences , and then select the display tab to assure you that:

    Display remote messages HTML images is selected.

  • Why this scriipt does not work with Firefox? < embed src = "News2008Fall.pdf" width = '615' height = '3200' > < / embed > "

    Please tell me why this script does not work with Firefox. It works with Safari. Here is the page that includes the script: www.lionsgatehoa.org/newslettertest.html. Thank you. Tom Engleman

    Here's the script in my html document:

    < embed src = "News2008Fall.pdf" width = '615' height = '3200' > < / embed > "

    Edit: removed # phone

    Works for me on Linux.

    Your system details list does not display the Adobe Reader plugin, so you'll have to (re) install this program.

    See:

  • I just upgraded my Firefox to version 9.0.1, I get multi-page opening now when I launch my browser. A page is my home page, another is welcome to Firefox, and the other is my LassPass. Can anyone tell my why this is happening?

    A page is my home page, another is welcome to Firefox, and the other is my LassPass. Can anyone tell my why this is happening?

    Create a new profile as a test to see if your profile is the source of the problems.

    See "basic troubleshooting: a new profile:

    There may be extensions and plugins installed by default in a new profile, so check that in "tools > Modules > Extensions & Plugins" in case there are still problems.

    If this new profile works then you can transfer files from the old profile to the new profile, but make sure not to copy corrupted files.

    See:

  • Why this page has missing elements in FFox 8.0 (running Lion 10.7)

    Why this page displays not the .png missing on the bottom.

    Looks fine in all other browsers

    http://www.jordieshapiro.com/home.html

    It seems to me. It's maybe just you need to clear your cache-> hold down the SHIFT key and click on reload. If it does not try to clear your cookies and cache - cache and delete cookies

  • Unable to run email of announcement of Craigslist with Firefox web browser. The link works fine when you use Internet Explorer. Don't know why this problem?

    When I click on send to a Craigslist of announcements of sale, e-mail software does not run. When I used the same craigslist Web page with Internet Explorer, the e-mail program runs without any problem. Not sure why this problem?

    If you change your preference of mail helper in Firefox for 'other use '.... "you are presented with a command prompt to select an application click 'Browse... '. "and browse your computer for the program of choice. Even if you're already shown two e-mail programs, try to re - select the one you want to use via the method go and then try again to open a mailto link.

    If this does not work, open your profile button in folder

         Help > Troubleshooting Information
    

    and the release of Firefox. With Firefox closed, remove the file "mimeTypes.rdf" of your profile folder, and then restart Firefox and Firefox will re - build the helper, file applications and you can try again to send someone from a link.

  • I can't download IOS 9.3.1 the download starts but then an error message appears and it stops. I have enough storage, so don't know why this is happening?

    I can't download IOS 9.3.1 the download starts but then an error message appears and it stops. I have enough storage, so don't know why this is happening?

    Does anyone else have this problem?

    It often happens when the screen times out and goes to the lock screen, when I connect to my phone that the error message is re-appeared?

    I have the same problem!

Maybe you are looking for