EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Memory issue with SecureBB (SSL)

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#2547
Posted: 03/17/2007 12:19:56
by Krish A (Basic support level)
Joined: 11/19/2006
Posts: 10

I have opened a ticket with the support team. I am also posting this message on the Forum. Maybe someone out here has already faced this issue and has a workaround or a fix. We have our production server application using the SecureBB library for processing client connections over SSL.

Product: SecureBlackbox for .NET v5.0.104 (SSL) under .NET 1.1 Framework

My server application Virtual Memory increases drastically continuously. This is happenning as the server gets more and more connections from clients. Even after all clients have disconnected - the Virtual Memory stays there and never comes down. Eventually my server memory runs out and an OutOfMemoryException is printed on the server console. Therefore, every few hours, I am forced to restart the server application to handle the traffic.

We have analyzed secureBB sample server application and modified the sample client application to determine the cause of the issue. We used the ANTS Memory Profiler to do this.

Here are our primary conclusions:
1) The SBB server Virtual Memory (private bytes) usage increases continuously as more and more clients connect to the server.
2) Objects created by the server are always being referenced some other object - therefore not being collected by the GC ever.
3) Even after all clients have terminated - the VM usage of the server stays the same (does not decrease at all) --- we have kept the server running for over 24 hours with no additional clients connecting but still the VM does not decrease. This means that .NET GC is not collecting the objects that are not in use anymore.

Here is our test report and analysis (please find ATTACHED client/server app):

==> Server Application:
----------------------------------
Polls for the incoming connections, accept the new connection and spawns a thread to do the processing. When the remote side connection is closed, server closes the connection and thread terminates.

==> Client Application:
--------------------------------
Connects the server, do a socket read/write and closes the connection infinitely.


==> Observations based on the ANTS memory profiler:
-----------------------------------------------------------------------------

1) Start the ANTS profiler for the server application and take initial snapshot without any client and server socket in the listening mode.

2) Under the performance counter, choose the private bytes for the server application process.

3) Start the client application and keep it running, observe the performance counter and private bytes for the server process is always increasing.

4) Take another snapshot using the ANTS profiler, we can see some instances of the objects as identical (to the previous snapshot) but their "age" is increased (i.e they are not collected by GC) because they are referenced by at least one object.

5) look for some of the new objects, there are some objects which may have "age" as zero, means since they are created there is no cycle of GC.

6) Take the third snapshot. Again their are some identical objects and their age is increased is further. And here we can see that the some of the objects which are new in the second snapshot are marked as identical but their age has increased. This means these objects are not cleared as someone is referring to these.

Not sure but since we are closing the socket every time we are done with the socket operation, memory should be freed.

7) For each snapshot we can also compare the number of live objects and the size of live objects, and both the numbers are increasing.

8) If we kill the client application, the server memory stays there and will never come down.

9) If we modify the client application as, just connect the server once and only do read/write operations on the socket then there is very small increase in the private bytes.

Any help or suggestions are appreciated regarding this matter.


[ Download ]
#2559
Posted: 03/19/2007 08:36:29
by TJ Kolev (Standard support level)
Joined: 12/02/2006
Posts: 6

Hi!

Just for the record, I also have exactly the same issue with the memory usage. I have not done any profiling yet. I called GC.Collect() and it could not release any memory, which points to references being kept somewhere. I am running 5.0.0.107.

tjk :)
#2562
Posted: 03/19/2007 11:04:33
by Eugene Mayevski (EldoS Corp.)

The problem can't be reproduced, unfortunately. ANTS reports some results which are totally unrelated to the code internals and AQTime 5 doesn't detect any leaks.

As said, leaks in .NET applications happen due to the global objects which hold references to other objects. SecureBlackbox doesn't have such global objects.


Sincerely yours
Eugene Mayevski
#2565
Posted: 03/19/2007 11:45:03
by Krish A (Basic support level)
Joined: 11/19/2006
Posts: 10

So what is the resolution? There is a problem with even the sample client/server application. How can we fix this?? I am running a production application with SecureBB and its getting painful restarting my application every few hours.
#2567
Posted: 03/19/2007 12:33:15
by Eugene Mayevski (EldoS Corp.)

None at the moment - some of the hanging items are structures allocated on the stack. I've got no idea why they are not collected properly. We will investigate the problem with compiler developer.


Sincerely yours
Eugene Mayevski
#2569
Posted: 03/19/2007 14:14:28
by Eugene Mayevski (EldoS Corp.)

Quote
TJ Kolev wrote:
Just for the record, I also have exactly the same issue with the memory usage. I have not done any profiling yet. I called GC.Collect() and it could not release any memory, which points to references being kept somewhere. I am running 5.0.0.107.


What .NET Framework version are you running the code on?
The issue is .NET 1.1-specific. The profiler doesn't report the hanging objects in VS 2005.


Sincerely yours
Eugene Mayevski
#2575
Posted: 03/19/2007 17:35:21
by Krish A (Basic support level)
Joined: 11/19/2006
Posts: 10

I am running the code on .NET 1.1
Are you suggesting that we won't see the memory leaks on the newer .NET 2.0 ?

If that is the case, it will be very difficult to migrate our application to .NET 2.0 since it is a production application. We need a fix for .net 1.1 only
#2578
Posted: 03/20/2007 07:28:58
by TJ Kolev (Standard support level)
Joined: 12/02/2006
Posts: 6

Hi!

I am running .Net 2.0.

tjk :)
#2579
Posted: 03/20/2007 08:25:51
by Eugene Mayevski (EldoS Corp.)

Then please post a meaningful sample which exposes a problem to helpdesk


Sincerely yours
Eugene Mayevski
#2580
Posted: 03/20/2007 08:30:06
by Krish A (Basic support level)
Joined: 11/19/2006
Posts: 10

I would like a concrete answer to my problem. Is there a phone number I can call? I have purchased this software and I need support. Am I correct to understand that you can't help me?
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

Topic viewed 7749 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!