Stephane and Melissa:
Initial report on the "Not enough memory...." problem:
I went to Detroit Diesel Monday and found that I could get everything to work PERFECT if I used applications written in LabVIEW. It turns out the customer has an application that uses "canned" routines in Visual Basic 6.0 to read and write to the tcp/ip. THese use "standard" Basic and Windows "OCX" files.
The question is" Have others found any incompatability with Visual Basic routines and LabVIEW routines dealing with TCP?IP in an NT environment that do not exist in a Windows 9X environment?
I will be working on this on Wed Mar 13, 2002.
Stephane: Have anything to add to the document below? Any new hints? Are all your applications in LabVIEW? When I make both server and client applications in LabVIEW I see ZERO ERRORS..... I can force the error predictably with a VB6.0 server and LabVIEW client! DOes VB6.0 use a different TCP/IP than LabVIEW? Are the other folks talking about LabVIEW-LabVIEW or "mixed"
Follows is the latest version of Melissa's Document: (Melissa: Have others contributed to the document below? If nobody knows the square root of 2 then send it to an engineer who does then I think we might propogate into the "big wizard" environment...
1. The errors we see only come around on NT so I wonder if there are any NT specific ports that we should stay away from?
There is no information available on Microsoft’s website regarding NT specific ports. The port you are currently using (6341) is listed as unassigned according to the reference below, so the port number should not be an issue here.
http://www.iana.org/assignments/port-numbers
2. Why do you ask about the port number?
I asked about the port number because at first glance of your front panel, I saw a control that was named “port number”. In it was a default value of 1, which would be a restricted TCP/IP port number. I then realized after you sent me the corresponding block diagram that this referred to the serial port number and not the TCP/IP communication port number.
3. Could a wrong port number cause this?
No. (See answer to question 1.)
4. What are the symptoms?
I’m not sure what you’re asking here. If you were asking what the symptoms are of using a “wrong” port number, then it would be a guess. I tried using port 80 for example (reserved for http), and I didn’t get any communication or any error. I also tried using a registered port (3015 for dstp) and communication worked fine.
5. The error is reported by Windows NOT LabVIEW. The error also only appears in Windows NT. The significance of this is:
Writing TCP/IP in a loop is most likely using up all of the connection ports and so the system
"runs out of memory (TCP/IP stack)". It depends on how often you are requesting TCP/IP connections in the system, but basically LabVIEW releases its TCP/IP connection and NT proceeds to hold onto the connection for an additional 240 seconds after we release. If this occurs often enough then the TCP stack can fill up and no more connections are available to handle the request. Take a look at the following MSDN articles. It may be that the Windows NT client is connecting often enough that it runs into these stack issues.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q149532
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q196271
6. The problem is in Windows NT and not 9X AND is ONLY if the CLIENT is on NT, The SERVER can be on "anything"?
This would have to be tested in order to be verified. My guess is that if either the client or server were on Windows NT this problem would occur since it is the connection between the two that is held by NT for the additional 240 seconds.
7. What are the definitions of “Server” and “Client” as used above in Questions 5 and 6?
The client/server model is a common model for networked applications. In this model, one set of processes (clients) requests services from another set of processes (servers). Another way to think about clients and servers is to use the restaurant analogy. The waiter is a server and you are a client. You ask for the menu, order a meal, and make requests of the waiter similar to the way a client communicates with a server on a network.
8. If it works in Windows 9X and not in NT then we ONLY have to fix the SERVER?
Again, this would have to be tested in order to be verified.
9. Does Windows 9X have the property of holding the connection for an additional 240 seconds?
There was no evidence on MSDN of Windows 9X holding its connection.
10. Why does LabVIEW immediately release the connection and Microsoft hold onto it for this additional 240 seconds?
According to Microsoft’s website: “The TCP/IP-state computer dictates that when a connection is closed, the connection is not released until two maximum segment lives (MSLs) have passed. This state is defined as the Time-wait state. Since one MSL is defined as 120 seconds, it takes four minutes for a closed connection to be released in TCP/IP.” This is a known issue at Microsoft, and therefore, I don’t believe they intended for this prolonged connection.
11. How big is the TCP/IP stack on Windows NT systems?
I haven’t found any definitive information yet on Microsoft’s website.
12. Is there a way to programmatically avoid this error?
The best way to avoid the error is to make the registry changes suggested in Microsoft’s Knowledge Base articles listed above.
13. Does Windows NT have a specific error for running out of TCP/IP stacks?
According to MSDN, there may be an event log created that says “Number of sessions exceeds 2048”. It doesn’t say anything about a definite error created.
14. The term "flooding" refers to what?
I’m not sure what the definition of flooding is, but I do have some new information regarding that message in the example program. The note on the diagram states that there is a 25ms delay in the server VI so that LabVIEW doesn't flood the input queue on Windows NT machines. When the Simple Data Server and Simple Data Client are run on the same NT machine, there are many Windows messages generated due to the data going back and forth. Without the delay, mouse clicks on the front panel will never be detected because they are queued up behind all the other messages and at a lower priority. If this is the case, the VIs will seem to hang. Adding in the delay will prevent this hang, but may or may not get rid of the “not enough memory” error.
15. Does the problem have anything to do with calls to DAQ devices?
This error has been narrowed down to the way Windows NT handles its TCP/IP connections.
16. The problem in this case has nothing to do with "memory leaks" caused by building HUGE arrays.
The question of memory leaks due to build arrays makes no sense in this situation unless you can see memory leaks. Using the NT task manager should provide enough info to determine if this is an issue. I believe that we previously determined that this was not happening.
17. The reason Windows NT reports the error the way it does, as a memory error, is not correct. Windows reports it this way because:
I’m not sure exactly why Windows says that it is a memory error, but it may be referring to the TCP/IP stack filling up.
Thanks,
Dave Korpi
korpi@starband.net