This will cause a memory leak?

Hello

I have a question about how AS3 garbage collection.  This will cause a memory leak?

var firstVector:Vector.<String> = new Vector.<String>;
var secondVector:Vector.<String> = new Vector.<String>;

firstVector.push("foo");
firstVector.push("bar");
// firstVector now contains foo,bar

secondVector.push("baz");
// secondVector now contains baz

firstVector = secondVector;
// firstVector now contains baz

'Foo' and 'bar' exist in memory somewhere now?  In other languges such as Objective-C, if the first vector cannot be erased first before being assigned the second vector data, the first vector data, then that is not accessible, still exist in memory.

Thank you!


I think that they stayed in the memory, but we can't reach them because they do not have a reference variable.

in java, we know that the String class is immutable.

ArrayList - vector in AS3 - is also immutable too.

so when the flash vm excute the first line:

1 - vm will create two ref first, vm and the second table set the size for them like it by default size

2 - the vm will creat a new string 'toto' in reference 0 of the firstarray - you learned in Assembly.

3 - Add a new string 'bar' in 1 side firstArray address in memory

4. new 'baz' and assign the secondArray mention

the importance is here

now when you equal first with the second, just by moving the pointer in the first table to the "baz".

Baz has therefore two now first and second reference table

foo and bar will remain in the memory, garbage will delete them after some time cause there are no variables that were

You can also call garbage collection operation by:

flash.system.System.gc ();

Tags: Adobe Animate

Similar Questions

  • When you try to move an image to a folder, whatever that means - "this will cause the file on the disk to remove. If you continue, this movement or any changes you made before it can be canceled?

    When you try to move an image to a folder, whatever that means - "this will cause the file on the disk to remove. If you continue, this movement or any changes you made before it can be canceled?

    I saw wording like this before, and I don't think it's anything to worry about. I don't know why Adobe chose these specific words, that your changes are certainly editable after the move.

  • Since the upgrade to Sierra MediaLibraryService is causing a memory leak

    Hello.

    I upgraded to Sierra, since as soon as Itunes is launched, the com.apple.medialibraryservice is originally a large memory leak, it keeps in ram more until she takes all (16 GB) and significantly slows down the computer.

    I tried to reset the nvram and smc memory, doesn't change anything.

    Does anyone have an idea on what is causing this leak and is there a solution?

    Yes, I noticed this also. After that I opened iTunes, it's just a matter of time before all the memory gets used up and all departure is wobbly. In particular, bluetooth really gets bug after a certain time, and as soon as I quit iTunes, that's fine.

  • Start page Mozilla Firefox causing extreme memory leaks?

    For some reason, when I opened my Firefox today, so bad that I have my computer crashes all also blocks... Even if I close and reopen Firefox, it still hangs... So the only option I have is to complete the process... However, if you wait long enough after my crashes Firefox, it won't hang on and working normally again. For this reason, I did a little investigation to know what could be the cause why my Firefox keeps hanging after the start, and I found an answer to this. I discovered that my Firefox Start Page was the main reason why it crashes. I have concluded that, because when I changed my home page to start on a blank Page, it does not crash, and whenever the Start Page is displayed, I noticed that the firefox.exe process on my task manager going up to 1 000 000 + K of memory... which is obviously abnormal... So the question is, how do I fix?

    See response of cor - el on my page of problem (I had the same problem) a solution that works:

    https://support.Mozilla.org/en-us/questions/984223

  • iPhone 4, sim card installed when sold to the left. This will cause me any grief later?

    Hello

    I recently sold my wife 4 iPhone and forgot to remove the sim card.

    I don't know that I wiped the data on the phone, the phone had the startup message "Hello", if I remember correctly.

    Are there steps I must take to protect all data that may be on the sim module.

    Thank you.

    No - not really - the buyer must replace your SIM card - you can talk to your carrier about the end of service on this map (if they have the details of this)

    If clear you the phone then there are not visible in your list of devices when you connect to iCloud

  • Blue screen and crushed; Hard Drive 'HEALTH' this will cause?

    Original title: hard drive 'HEALTH'

    I had a blue screen and crashed the day before yesterday; I tried to the already posted the option TOOLS inder, no SOLUTION appears. I would like to know if my hard disk is ok or if I need to call a serive to work on the machine. I have some very important information on my machine. Download the disk is not wise because of confidentiality.

    Moved from Vista Performance and Maintenance Forum.

    Be able to solve what could be the cause of your failed system, to the dump files. In an ideal situation, several files would be necessary to establish a model so if you have more than one, please download them.

    Please refer to the link below to get the procedure recover, zip and upload them to the site as onedrive, file sharing google "dropbox, etc.".

    When you are finished, make public the folder and share the link here.

    Blue Screen of Death (BSOD) created by ZigZag3143 (MS - MVP)
    http://answers.Microsoft.com/en-us/Windows/wiki/windows_other-system/blue-screen-of-death-BSOD/1939df35-283f-4830-A4DD-e95ee5d8669d

  • I have replace a motherboard recently, this will cause my laptop freeze after the start of dv6753cl to dv6911om?

    After starting my hp Pavilion now dv6911om freeze and sometimes during the open page. I have Windows Vista Home Premium 32-bit x. Please help, my first pc and still learning how to use it.

    Hello

    replacing the motherboard needs to be done in collaboration with the computer manufacturer; in this case HP

    When vista is preinstalled as an OEM license and the license of vista is linked to the original motherboard and vista license channels when this computer dies

    the original motherboard drivers would be also loaded on vista operating system preinstalled

  • Shared Variable memory leak

    Hi all

    I have an urgent matter with sporadic memory leaks in shared variables.

    Occasionally, reading and writing to the variables shared a memory leak. The rate can be increased by turning on "Flush static Variables' disabled in the code,

    I was not able to reproduce with variables shared on the localhost variables however shared running on a target RT PXI seem to cause this problem.

    It is as if something breaks sometimes and causing memory leaks. Perhaps a matter of concurrency of thread/pointer?

    Steps to reproduce:

    1. Start the MemoryLeak.vi and sometimes it does, other times it does not leak memory slowly.
    2. Select the "Flush the shared Variable" vi behind disable schema structure
    3. Watch the memory usage go amok after the restart of the MemoryLeak.vi
    4. Disable the "Flush shared Variable' behind the structure diagram disable
    5. Restart the MemoryLeak.vi and memory leak continues at different speeds depending on how it breaks.
    6. Will cause a memory leak whenever I run the vi, reboot only LV will put it in somewhat nonleaking condition.

    System information:

    • Latest & most f0 LV2012 32-bit SP1 on client and target systems fully implemented at level
    • Client computer Lenovo Thinkpad W530 Win7 Professional 64-bit
    • SMU-8135 controller on an SMU-1078 performer LVRT 12.0.1 cassis

    Help here to an AE or R & D would be nice that I can't solve this problem on my own.

    See photos attached.

    BR,

    / Roger

    CAR #403386 was created to follow up on this matter.

  • TDMS write memory leak

    I use TDMS to store test data that seems to be causing a memory leak in my (very convincingly) program. Below is a graph of the three versions of my program. Series 1 uses storing data open PDM, the data file added and closed every 5 seconds. Series 2 uses storing data PDM with a referense remaining open during operation and closed at the end 3 series written data in a CSV file. The charts show the use of LabVIEW memory each seconde.5 ~ 4 hours of a 10 hour test.

    LabVIEW 8.6.1

    Windows XP SP3

    Further explanations... when a TDMS file is opened, LabVIEW will create an index in memory structure that is used for random access to the file. The Streaming API integrated LabVIEW TDM will always create the index, even if you just write. The size of the index is not dependent on the size of the file, but on how fragmented file is. If you store a relatively small number of large blocks of data, the index will be very low. If you keep adding small amounts of data on your record, it could make big enough. A cure for this is the property of NI_MinimumBufferSize. You can set this property on a channel to the LabVIEW to a number of values of the buffer before storing. In this way, data from multiple calls to 'Write TDMS' counts as a data segment in the file. Typical values for this are 1000 or 10000. Fragmentation of files and memory footprint are reduced accordingly, but LabVIEW uses little memory for buffers.

    If all else fails and you do not have access to the file of reading while you write, you can also use the VI-based TDMS API. This will not build the structure of the index that I mentioned above, so there should be no increase in memory at all. In this case, I recommend to defragment files front of post-processing.

    Hope that helps,

    Herbert

  • Memory leak flow network with cluster of berries

    I use the network stream in sbRIO application, and I see a memory leak when endpoint RT is connected Windows endpoint. This happens with endpoints of chain and cluster tables parameters. I've attached an example that shows the behavior.

    I found this KB, which seems to explain the problem, but the solution it offers is just to spend on scalar types: http://digital.ni.com/public.nsf/allkb/784CB8093AE30551862579AB0050C429

    I can't do it in my application; I need scalar data with a block of channels multiple samples and send the package everything together (as seen in the typedef that I included with the attached example). How can I handle this without creating a memory leak which will eventually cripple my application?

    Never mind. Definition of the size of the buffer to a lower value, got flight' to stop. I had it so great that the buffer allocated is still all the time that I was monitoring the application. When I changed to 50 elements, he has only spent a few seconds allowance, then stopped the "leak".

  • Memory leak when just launched and the idling... corrections when used?  [HELP]

    So I'm in the stage of debugging and test my application and use of this tool for tracking memory leaks ( https://github.com/mrdoob/Hi-ReS-Stats )

    When I run my application my numbers are

    FPS: 61/60

    MS: 17

    MEM: 3.157

    MAX: 3.157

    Now my memory starts immediately from 3.157, 3.167, 3.177 3.187 3.197 and so on.

    Now, if I do any selection of nav in my application

    Changes down to approximately 3,215 MEM

    but then it starts to count down again 3,215 3,225, 3.235, 3.445 3.455

    I don't have loops that pass.

    Has anyone encounter this?

    I'm almost tempted to force garbage collection every 60 seconds that the application is inactive or something.  Not the best way to handle this...   I don't know where the leak occurs.

    Any help is appreciated!

    See you soon!

    Oh man!...   So I created a new stage and only put the Profiler on the stage... and it's the same thing.  ...    So I think it's the Profiler itself which causes memory to continue to increase.

    Then...    How can we really test my application for leaks memory, etc. ?

  • ADFContext WARNING memory leak

    We are seeing the warning below the newspaper too often. (Build JDEVADF_11.1.1.7.2ADF - FAREL8 - BP_GENERIC_131030.1412.6661.3)

    < oracle.adf.common > < ADFContext > < getCurrent > < automatically a DefaultContext of getCurrent initialization.

    The caller must ensure that a DefaultContext is suitable for this purpose.

    Memory leaks or unexpected behavior may occur if the automatic initialization completed successfully.

    This message can be avoided by doing initADFContext before using getCurrent().

    For more information please activate logging for oracle.adf.share.ADFContext at the HIGHEST level. >


    How to remove this warning?

    To my knowledge, you can't.as that the message is recorded as being the only way would be to set the log level to error on the server for st under the oracle.adf.share.ADFContext of the class

    Be careful if you go this way you may lose other warnings too.

    If you have a valid service contract, you can open a SR with support.oracle.com.

    Timo

  • On firefox memory leaks cause blue screens?

    On firefox memory leaks cause blue screens?

    If you encounter blue screen crashes, this majority refers often to an incompatibility with a device driver, especially the graphics drivers. Go to Firefox Safe Mode and disable the use of Firefox hardware acceleration of graphics.

    Assuming that Firefox is closed:

    Hold down the SHIFT key when you start Firefox. You should get a small dialog box. Click on 'Start mode safe' (not reset).

    (If Firefox is running, use Help > restart with disabled modules to call the dialog box.)

    In Firefox, open the Options of the Advanced tab dialog box:

    the button Firefox orange (or the Tools menu) > Options > advanced

    In the mini ' General' tab, uncheck the box for "use hardware acceleration when available.

    This will take effect after you exit Firefox and start it up again (in normal mode).

  • My Apple Macbook late 2009 has been upgraded to 4 GB and Mountain Lion but runs very slowly. When I check the memory system activity monitor, I see that there are 1.6 GB inactive. Is this the cause of the slowness and what I can do?

    My Apple Macbook late 2009 has been upgraded to 4 GB and Mountain Lion but runs very slowly. When I check the memory system activity monitor, I see that there are 1.6 GB inactive. Is this the cause of the slowness and what I can do?

    Reinstall OS X from scratch and add more RAM.

    Ways to help make a slow Mac faster

    17 reasons why your Mac runs slower than expected

    Slow performance of Mac? This Article addresses!

    Difficulty of slow start in OS X | MacFixIt - CNET Reviews

    6 easy tips to speed up OS X Yosemite on your Mac.

    Avoid using third-party software that claims to clean your computer. This software does more harm than good. In addition, you don't need it. Note that all computers become slower over time even in the normal conditions of use. Generally, the experienced users erasing the hard drive and do a clean install from scratch at least once a year or every time that the installation of a major upgrade of the OS. Well sure doing so also means that you need to maintain regular and several backups.

    Add more RAM or reduce the number of simultaneously executed from applications and utilities. Remove unnecessary software such as anti-malware and that promises to clean your Mac. Look for the runaway process: Runaway applications can shorten the battery life, affect performance and increase the heat and fan acti... See also:

    Before Mavericks

    Open the activity monitor in the Utilities folder.  Select all processes in the drop process .  Click the % CPU column heading twice to display in descending order.  If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    Mavericks and later versions

    Open the activity monitor in the Utilities folder.  Select all processes in the menu display .  Click the CPU tab in the toolbar. Click the % CPU column heading twice to display in descending order.  If you find a process that uses a large amount of CPU %, then select the process, then click on the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    Things you can do to solve the slow Downs

    If your computer seems to run slower, here are some things you can do:

    Start with tours: OS X maintenance - MacAttorney;

    The X Lab: the X-frequently asked questions.

    " Safe mac" Mac Performance Guide;

    " Safe mac" the myth of the dirty Mac;

    Maintenance fast Mac Help.

    Start in Safe Mode , and then repair your hard disk and permissions:

    Fix the hard disk and permissions before Lion

    Boot from your OS X install disk. After the installer loads, choose your language and click on the button continue. When the menu bar appears select utility drive in the Utilities menu. After that the charges of THE select your entry from hard drive (mfgr. ID and car size) in the list on the left.  In the status area, you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is faulty or has failed. (State SMART is not reported on external drives Firewire or USB). If the drive is "verified", then select your OS X volume in the list on the left (subentries under the entry for the road), click the first aid tab, then click the repair disk button. If THE reports any errors that have been corrected, and then run repair disk again until no errors are reported. If no errors are reported, click repair permissions. Wait until the operation is complete, then exit FROM and return to the installer.

    Repair the hard drive - Lion-Lion/mountain/Mavericks

    HD recovery start:

    Restart the computer and after the buzzer, press on and hold down the COMMAND and R until it appears the screen of Menu utilities. Otherwise, restart the computer and after the buzzer, press on and hold down the OPTION key until the Boot Manager screen. Select recovery HD disk icon and click on the button below.

    When the recovery menu appears, select disk utility. After that the charges of THE select your entry from hard drive (mfgr. ID and car size) in the list on the left.  In the status area, you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is faulty or has failed. (State SMART is not reported on external drives Firewire or USB). If the drive is "verified", then select your OS X volume in the list on the left (subentries under the entry for the road), click the first aid tab, then click the repair disk button. If THE reports any errors that have been corrected, and then run repair disk again until no errors are reported. If no error is not reported, then click repair permissions. Wait until the operation is complete, then exit FROM and return to the main menu. Select restart from the Apple menu.

    Restart your computer normally and see if it helped at all. Then do little maintenance:

    For disk utility can't handle situations, the best third party is Disk Warriorutility;  Fixed DW only for problems with the disk directory, but most disk problems are caused by the corruption of directory; Warrior drive 4.x is now compatible with Intel Mac.

    Note: Alsoft ships DW on a bootable DVD that will boot Mac running Snow Leopard or earlier. He cannot start Mac that came with Lion or later preinstalled, however, DW will work on these models.

    Suggestions for OS X maintenance

    OS X performs certain maintenance functions that are supposed to take place on a daily, weekly, or monthly period. Maintenance scripts that are run at the beginning AM only if the computer is turned on 24/7 (no sleep). If this isn't the case, then a great solution is to download and install a shareware like Macaroni, JAW PseudoAnacronor Anacron utility that will automate the maintenance regardless of whether activity if the computer is off or asleep.  Dependence on third-party utilities to run periodic maintenance scripts has been significantly reduced since Tiger.  These utilities have little or no functionality with Snow Leopard or later version, and must not be installed.

    OS X automatically defrags files smaller than 20 MB in size, so unless you have a disk full of very large files it little need to defragment the hard drive.

    Under no circumstances should you install operating MacPaw or ZeoBit software (CleanMyMac/CleanMyDrive or Mac Keeper, respectively.) You don't need special software to keep your computer.

    Useful links about malware Protection

    "If you have an immediate problem with ads popping up see the Mac without danger" Adware removal Guide and AdwareMedic.

    Open Safari, select Preferences from the Safari menu. Click the Extensions icon in the toolbar. Disable all Extensions. If it stops your problem, then re-enable one by one until the problem returns. Now remove this extension as it is the origin of the problem.

    The following comes from user stevejobsfan0123. I made minor changes to adapt to this presentation.

    Difficulty a few pop ups browser that supported Safari

    Common pop - ups include a message saying that the Government has taken over your computer and you pay release (often called "Moneypak"), or a false message saying that your computer has been infected and you need to call a number of tech support (sometimes claiming to be Apple) to get it to be resolved. First of all, understand that these pop-ups are not caused by a virus and that your computer has not been assigned. This "hack" is limited to your web browser. Also understand that these messages are scams, so don't pay not money, call number, or provide personal information. This article will give an overview of the solution to remove the pop-up window.

    Quit Safari

    Usually, these pop-ups will not go by clicking 'OK' or 'Cancel '. In addition, several menus in the menu bar may become disabled and show in grey, including the option to leave Safari. You'll probably force quit Safari. To do this, press command + option + ESC, select Safari, press on force quit.

    Relaunch Safari

    If you restart Safari, the page will reopen. To avoid this, hold the "Shift" key when opening Safari. This will prevent windows since the last time that Safari was running since the reopening.

    It will not work in all cases. The SHIFT key must be maintained at the right time, and in some cases, even if done correctly, the window is displayed again. In these circumstances, after force quit Safari, turn off Wi - Fi or disconnect Ethernet, depending on how you connect to the Internet. Then restart Safari normally. He'll try to reload the malicious Web page, but without a connection, it will not be able to. Leave this page by entering a different URL, i.e. www.apple.com and try to load it. Now you can reconnect to the Internet and the page that you entered is displayed rather than the malicious.

    An excellent link to read is Tom Reed Mac Guide of malicious programs.

    Also, visit the FAQ XLab and read of detection and avoid malicious software and spyware.

    Check out these articles from Apple:

    Mac OS X Snow Leopard and malware detection

    OS X Lion-Protect your Mac against malicious software

    OS X Lion mountain - protect your Mac against malicious software

    OS X Mavericks-Protect your Mac against malicious software

    On the quarantine of file under OS X

    If you need antivirus protection Thomas Reed recommends to use ClamXAV. (Thanks to Thomas Reed to this recommendation.)

    The user Joe Bailey comes this equally useful advice:

    The facts are:

    1. There is no anti-malware software can detect 100% of malware out there.

    2. There is no anti-malware that can detect all targeting the Mac.

    3. the best way to prevent breaches the most is for you as the user is aware that

    the most successful malware attacks rely on sophisticated social engineering

    techniques preying on human greed, * and fear.

    4 Internet pop-up windows telling the FBI, NSA, Microsoft, your ISP has detected malware on

    your computer is designed to trick you into installing their malware thinking it's a

    protection against malware.

    5. some of the anti-malware market products are worse than malware

    go where they are supposed to protect you.

    6. be careful where you go on the internet.

    7. don't download anything from sites, you know are safe.

    8 avoid links that you receive in email, always be wary, even if you get something

    you think a friend is, but that you did not expect.

    9. If there is any question in your mind, then assume that it is malware.

    Troubleshooting Applications

    I recommend that you download a utility such as TinkerTool System, OnyX, Mavericks Cache Cleaneror hiding a Cocktail that you can use to delete the former newspapers and archives, cleaning, etc. Corrupted cache, logs or temporary files can slow down the application or OS X crashes and panics of the kernel.

    If you have leopard snow or leopard, then for similar repairs install Applejackfreeware utility.  If you do not start in OS X, you can boot into single-user mode , where you can run Applejack to make a set of routines for repair and maintenance of the command line.  Note that it takes 1.5 AppleJack for Leopard. AppleJack 1.6 is compatible with Snow Leopard. Applejack does not work with Lion and later versions.

    Basic backup

    For some people, Time Machine will be more than enough. Time Machine is part of Mac OS X. There are two components:

    1. a panel of Time Machine preferences as part of the system of preferences;

    2. a request for Time Machine, located in the Applications folder. It's

    used to manage backups and restore backups. Time Machine

    requires a backup drive that is at least twice the capacity of the

    drive being backed up.

    You can also get an external drive at least equal to the size hard disk internal and make (and maintain) a bootable clone/backup. You can make a bootable clone using the disk utility's restore option. You can also create and maintain clones with good backup software. My personal recommendations are (the order is not significant):

    1 Carbon Copy clone

    2. get backup

    3 already seen

    4 superDuper!

    5. Synk Pro

    6. Tri-Backup

    Visit The FAQ XLab and read the FAQ on the backup and restore.  Also read How to back up and restore your files. For using Time Machine, visit FAQ Time Machine of Pondini for help with all this time Machine.

    Referenced software can be found at MacUpdate .

    Additional tips

    Make sure you have a sufficient amount of RAM installed for the number of applications you run simultaneously. Make sure to leave a minimum of 10% of the capacity of the hard disk as free space.

    Add more RAM. If your computer less than 2 GB of RAM and you use OS X Leopard or later, then you can do it with more RAM. Snow Leopard and Lion works much better with 4 GB of RAM that is their system. Most concurrent applications, that you tend to use the more RAM you should have.

    Always have at least 15 GB, or 10% of the capacity of your hard disk as free space, the largest. OS X frequently accesses your hard disk, so offering enough free space will keep things slow down.

    Check for applications that may be hogging the CPU:

    Before Mavericks

    Open the activity monitor in the Utilities folder.  Select all processes in the drop process .  Click the % CPU column heading twice to display in descending order.  If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    Mavericks and later versions

    Open the activity monitor in the Utilities folder.  Select all processes in the menu display .  Click the CPU tab in the toolbar. Click the % CPU column heading twice to display in descending order.  If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    This problem occurs often because of a corrupted cache or the preferences file or an attempt to write in a corrupted log file.

  • LabView VB6 Dll interface causes memory leak

    Hello

    We use a large written in vb6 in our laboratory measurement built house software. Recently, we have added a new detector that is read using a labview vi that is called using a dll directly from vb6. Here, we call the function for example of read_detector which starts the collection of data and in a next step writes the data to a string. When you have finished the called function returns a pointer to the string and its length. VB6, we read this pointer and process data.

    This is a memory leak. This could be the case because we presets not memory for labview to write in and so just writing lab data in memory without releasing again? In the current configuration, the function of the dll is just called again and again and each lab view creates a variable outputstring.

    If we allocate the memory. How can we achieve for vb6?

    Best,

    Julian

    Well first of all, a handful of string LabVIEW is a very specific type of data LabVIEW. Not only is only LabVIEW himself knows exactly how to allocate and deallocate, but you must also allocate and deallocate in exactly the same instance of LabVIEW. Given that your LabVIEW DLL is executed for this purpose inside the DLL to run LabVIEW, you must also recover the LabVIEW memory manager functions according to DSDisposeHandle() of the lvrt.dll and call it after you are finished with the strings returned by the DLL function. This is however made very complicated since there are circumstances where not lvrt.dll is actually used by your DLL but another LabVIEW runtime system. And if you happen to have two DLLs created with different versions of LabVIEW LabVIEW, each of them will load and use its enforcement LabVIEW system according to DLL load next. Believe me, you don't want to know how next dll works and how to make this opportunity to work in an application. This is the way for Microsoft to create a monster to manage the hell of the DLL and in this way, rather to create exponential version of hell.

    You create just two memory leaks for each call of DLL function at the moment. LabVIEW creates a new handle of string for each of the parameters string at each call, you dereference the pointer, and then copy the contents into a SysString. But you let the chain handles LabVIEW blow created around the stack and the next your function call, you initialize the new variables of the battery which is initialized to null and LabVIEW creates two new handles. Also you need to do is to define an "Integer DSDisposeHandle(LStrHandle As Long)" exported lvrt.dll function and call it once you have copied the data of the handle in your SysString for both of these handles.

    But basically calling a DLL LabVIEW from no LabVIEW code and using LabVIEW handles string or array as parameters is several times more trouble that it's worth. The easiest would be fair, allocate a large enough buffer beforehand and pass those to the Configuration of the service DLL LabVIEW function to not accept a handful of string LabVIEW but a pointer to a string C instead. Do you work around the problem on the memory allocated by someone else to worry about your own program of VB and duty he properly release. The disadvantage of this approach is, that you should make sure that the memory allocated buffer is large enough for the maximum possible length that your DLL function may never return.

    But another approach might be to leave out LabVIEW total here and call the DAQmx APIs directly from VB.

Maybe you are looking for