Execute() In Class Microsoft.SqlServer.Dts.RunTime.Package Has Memory Leak

May 17, 2006

The Execute method in Microsoft.SqlServer.Dts.RunTime.Package class has memory leak after each invokation. This following code demonstrates it.

Output from the program:

Allocated memory after 1 iteration(s) = 476316
Allocated memory after 2 iteration(s) = 546448
Allocated memory after 3 iteration(s) = 555008
Allocated memory after 4 iteration(s) = 563632
Allocated memory after 5 iteration(s) = 572232
Allocated memory after 6 iteration(s) = 580856
Allocated memory after 7 iteration(s) = 589480
Allocated memory after 8 iteration(s) = 598240
Allocated memory after 9 iteration(s) = 606816
Allocated memory after 10 iteration(s) = 615424
Allocated memory after 11 iteration(s) = 624000
Allocated memory after 12 iteration(s) = 632576
Allocated memory after 13 iteration(s) = 641152
Allocated memory after 14 iteration(s) = 649728
Allocated memory after 15 iteration(s) = 658352
Allocated memory after 16 iteration(s) = 666948
Allocated memory after 17 iteration(s) = 675760
Allocated memory after 18 iteration(s) = 684380
Allocated memory after 19 iteration(s) = 693008
Allocated memory after 20 iteration(s) = 701532



//-----------------------------------------------------------------------------

// The Execute method in Microsoft.SqlServer.Dts.RunTime.Package has memory

// leak. This program demonstrates it. The package invoked by this program has

// only a single 'Script Task' that does nothing.

//

// To compile, add referece to Microsoft.SQLServer.ManagedDTS.dll.

//

// csc /r:"C:Program FilesMicrosoft SQL Server90SDKAssembliesMicrosoft.SQLServer.ManagedDTS.dll" ExecPackage.cs

//

//-----------------------------------------------------------------------------

using System;

using System.Diagnostics;

using Microsoft.SqlServer.Dts.Runtime;

namespace Misc

{

/// <summary>

/// Programmatically executes SSIS package, then displays memeory usage

/// after each execution. The memeory usage goes up after each

/// Package.Execute() call, which indicates memory leak!

/// </summary>

static class ExecPackage

{

static void DisplayUsage()

{

Console.WriteLine(@"Usage: ExecPackage <pkgName>");

Console.WriteLine(@" Package <pkgName> resides in Package Store on localhost under File System");

}

static void Main(string[] args)

{

// Parse command line arguments.

if (args.Length != 1)

{

DisplayUsage();

return;

}

string pkgName = @"File System" + args[0];

// Programmatically execute the package several times.

Application app = new Application();

for (int i = 1; i <= 20; i++)

{

Package pkg = app.LoadFromDtsServer(pkgName, "localhost", null);

pkg.Execute(); // comment out this line, then allocated memory does not increase

// Process.Start("dtexec.exe", "/dts "" + pkgName + """);

pkg.Dispose();

pkg = null;

// Do garbage collection, then display memory usage

GC.Collect();

Console.WriteLine("Allocated memory after {0} iteration(s) = {1}",

i, GC.GetTotalMemory(true));

}

}

}

}

View 36 Replies


ADVERTISEMENT

About Adding Connections In Microsoft.SqlServer.Dts.Runtime Package Class

Oct 25, 2007

Hi,

I have de following code:

ConnectionManager adventureWorks = package.Connections.Add("OLEDB");


I´m wondering how to make a connection to a file in differents machines, FTP, excel file, HTTP, WebService instead of OLDDB, where can I find a reference for the constants that must be used in each case.

thanks.

View 1 Replies View Related

Error 80040154 Using Microsoft.SqlServer.Dts.Runtime.Package

May 8, 2008

I am executing an SSIS package from VB.NET code. Works great in design mode. When I publish it (using Click-Once), it works great on development computer but fails on a customer computer:

Microsoft.SqlServer.Dts.Runtime.DtsPipelineException: Retrieving the COM class factory for component with CLSID {E80FE1DB-D1AA-4D6B-BA7E-040D424A925C} failed due to the following error: 80040154. ---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {E80FE1DB-D1AA-4D6B-BA7E-040D424A925C} failed due to the following error: 80040154.
at Microsoft.SqlServer.Dts.Runtime.Package..ctor()
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Dts.Runtime.Package..ctor()

My project references Microsoft.SQLServer.ManagedDTS.

The error occurs on the following line:

Dim objPackage As New Microsoft.SqlServer.Dts.Runtime.Package

Looking at various forum threads, it would appear that it's because either (1) DLL(s) are not registered on the customer machine, or (2) DLL(s) are missing from the customer machine. The first explanation doesn't seem right -- even though Microsoft.SQLServer.ManagedDTS is a COM dll, doesn't .NET provide a wrapper when it references it? I downloaded Process Explorer from Sysinternals.com to compare loaded DLLs on my dev box to those on the customer's box and while several dlls are loaded when the line is successfully loaded, all of them exist on the customer box.

Any help would be greatly appreciated.

View 17 Replies View Related

How Do You Troubleshoot Memory Leak Issues? What Tools Can Use To Diagnose Memory Leak Problems? In MS SQL ?

Mar 20, 2008

Hello frnds Can Anybody explai what does it mean by question itself and how to resole it ?

View 2 Replies View Related

Microsoft.SqlServer.DTS.Runtime

Oct 22, 2007

I am trying to launch a SSIS package remotely, and found this article http://technet.microsoft.com/en-us/library/ms403355.aspx#agent

however, i cannot add a reference to Microsoft.SqlServer.DTS.Runtime ? My Visual Studio 2005 interface does not show that as a possible reference when using "Add Reference"

How can I fix that?

Thanks

View 4 Replies View Related

Microsoft.SqlServer.Dts.Runtime

Oct 18, 2007

I'm trying to run a piece of code in BOL and it imports the dts.runtime class. The problem is when I do the import statement in my form, I get the green line. It can't find the class. The only class found inside SqlServer is Server.

Can anyone tell me why the DTS class isn't there. The box I'm working on has visual studio 2005, and Yukon sp2. And I think I'm running v.3 of the framework, so I should be good all the way around.

Thx.

View 4 Replies View Related

Why Do I Need Microsoft.SqlServer.Dts.Runtime.Wrapper Namespace

Jul 18, 2006

Hi,

It states pretty clearly in the documentation for the Microsoft.SqlServer.Dts.Runtime.Wrapper namespace that "This assembly is a Primary Interop Assembly (PIA) for the namespace Microsoft.SqlServer.Dts.Runtime, which is the assembly Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll). The classes in this namespace should not be instantiated. Instead, use the classes found in the Microsoft.SqlServer.Dts.Runtime. "

 

And yet as I have found out earlier today and talked about here, sometimes it is absolutely necassary to use Microsoft.SqlServer.Dts.Runtime.Wrapper. Why is this? Why is there no class in Microsoft.SqlServer.Dts.Runtime that allows me to access the specific connection managers rather than using the generic ConnectionManager class?

-Jamie

 

 

 

 

View 3 Replies View Related

Microsoft.SqlServer.Dts.Runtime &&amp; ASP.NET Identity Problem

Dec 21, 2006

Greetings,

I have an ASP.NET web form that calls out to a component which includes the following code which leverages the Application and Package classes in the Microsoft.SqlServer.Dts.Runtime namespace:

Application application = new Application();

Package package = application.LoadFromDtsServer(@"File SystemMyPackagesMyPackage", "MyMachine", null);



string id = package.ID;

Microsoft.SqlServer.Dts.Runtime.DTSExecResult result = package.Execute();

I am logged in to the app as DomainMe.

I have Windows Integrated Authentication configured in IIS and am using Windows Authentication in ASP.NET. I am using impersonation to impersonate a fixed identity, say DomainBob. This has the following effect:

WindowIdentity.GetCurrent() returns DomainBob as expected since the process is being impersonated by DomainBob.

Thread.CurrentPrincipal.Identity.Name returns DomainMe as expected since the ASP.NET application is using Windows Authentication.

The id variable successfuly is initialized to the GUID of the package, proving that the package name is resolving, however, from the ASP.NET application, the package fails.

Issuing the ? package.Errors[0] command at the command window provides the following information:

{Microsoft.SqlServer.Dts.Runtime.DtsError}
base {Microsoft.SqlServer.Dts.Runtime.DtsObject}: {Microsoft.SqlServer.Dts.Runtime.DtsError}
Description: "An OLE DB error has occurred. Error code: 0x80040E4D.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E4D Description: "Communication link failure".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E4D Description: "Shared Memory Provider: I/O Error detected in read/write operation [4]. ".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E4D Description: "Login failed for user 'MyMachine\ASPNET'.".
"
ErrorCode: -1071636471
HelpContext: 0
HelpFile: null
IDOfInterfaceWithError: "{8BDFE898-E9D8-4D23-9739-DA807BCDC2AC}"
Source: "Packages MyPackage"
SubComponent: "Connection manager "DataMart""
TimeStamp: {12/21/2006 2:18:55 PM}

For some reason, the ASPNET process account is being passed to the package!

This makes no sense, because clearly, DomainBob is impersonating the worker process and all downstream resources should be accessed via DomainBob. This includes SQL Server Database Engine and I would imagine SSIS as well. ASPNET should not come into play at all since I am impersonating.

I also tried using regular (non-fixed identity) impersonation (<identity impersonate="true" />), but again, SSIS is trying to authenticate ASPNET, instead of DomainMe as would be expected.

This is definetely isolated to ASP.NET applications, because making the same call from within a unit test succeeds. It would seem that this is a definete issue because the behavior is inconsistent with ASP.NET security principles.

Has anyone else seen this problem?

Any direction or suggestions very much appreciated.

Thanks,

Rick

View 13 Replies View Related

Microsoft.SqlServer.Dts.Runtime ASP.NET Security Issue

Dec 21, 2006

I am struggling in calling an SSIS package programatically using the Microsoft.SqlServer.Dts.Runtime namespace.

I am succesfuly connecting to the package insofar as I am able to retrieve the package ID (GUID), but when I call package.Execute I get a 'login failed for user' error, which indicates a security problem.

My ASP.NET app is running as a domain user which has temporary 'SA' rights on the server where the package is hosted. In addition, I have set the protection level on the package to 'DontSaveSensitive'.

What am I missing to be able to execute the package remotely?

TIA,

Rick

View 1 Replies View Related

Data Flow Task Is What In Microsoft.sqlserver.dts.runtime

Mar 3, 2006

when using the microsoft.sqlserver.dts.runtime to create packages programatically....

what object represents a data flow task?

View 1 Replies View Related

Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException HResult -2146233088

Apr 17, 2007

i get the following exception HResult -2146233088

[Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException] {"No description found"} Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException

when i try to use this following code snippet



try

{

ConnectionManager objOLEDBConnection;

Microsoft.SqlServer.Dts.Runtime.Package objPackage = new Microsoft.SqlServer.Dts.Runtime.Package();





objOLEDBConnection = objPackage.Connections.Add("OLEDB");

}

catch(Exception ex)

{

ex.Message ;

}


could you please help me out with this ?

View 2 Replies View Related

Com.microsoft.sqlserver.jdbc.SQLServerException.class Throws Java.lang.SecurityException

Feb 6, 2008

I'm trying to connect to a sql server 2005 express edition but have some trouble with it: i can connect to sql server through eclipse IDE but when I create a jar and try connecting to server, I get the following error.

Exception in thread "main" java.lang.SecurityException: invalid SHA1 signature f
ile digest for com/microsoft/sqlserver/jdbc/SQLServerException.class
at sun.security.util.SignatureFileVerifier.verifySection(Unknown Source)

at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
at sun.security.util.SignatureFileVerifier.process(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
at sun.misc.Resource.cachedInputStream(Unknown Source)
at sun.misc.Resource.getByteBuffer(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)


I'm using :
- os : winxp
- jdk1.5.0_06
- drivers : sqljdbc_1.1.1501.101 / sqljdbc_1.2.2828.100

is there anything i've missed? please, help me..

View 4 Replies View Related

VB.Net 2005 Setup Creation Gets Error Using Microsoft.SqlServer.Dts.Runtime

Feb 3, 2007

I have a very small project written in VB.Net 2005 using the SQL Server 2005 SSiS DTSx package.

I migrated a SLQ 2000 DTS package using the SQL 2005 Legacy tools and saved the package as a local .DTSx package on our file server.

I need to run the package from a clients PC.

I added the reference Microsoft.SqlServer.ManagedDTS so I could then use the Microsoft.SqlServer.Dts.Runtime so I can execute the commands:

Dim oApp As New Application
Dim oPkg As New Package
oPkg = oApp.LoadPackage(g_DTSx_Directory & "AOC copy Generic1 CSV to AOC_verify_file_1.dtsx", Nothing)
Dim oResults As DTSExecResult
oResults = oPkg.Execute

Ok. That works fine and is basically the entire app. It executes without a hitch in debug and as a compiled exe on my PC, but I have all the tools. So now I try and create a setup project for this and I use the setup wizard.

During the creation of the setup project I get a message that states:
The following files may have dependencies that cannot be determined automatically. Please confirm that all dependencies have been added to the project.
C:windowssystem32msxml6.dll

OK. The dll is part of the reference I mentioned above and I have no idea what other dependencies it may have.

How do I find this out?

Has anyone else created a project like this and experenced the same?

I am on a clean build running WinXP Pro with SP2 - VS2005 with SP1 and the SQL Server 2005 tools.

View 4 Replies View Related

Load/Run SSIS Packages On The Server From A .net Exe Exception:Microsoft.SqlServer.Dts.Runtime.DtsPipelineException: Retrieving.

Jul 28, 2006

Hello, I got an exception when I try to load/run a SSIS Package programmatically on the server using remoting.
The client machine has no SQL Server 2005 component installed..

This is the error I get from my exe application:

Microsoft.SqlServer.Dts.Runtime.DtsPipelineException: Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154.
---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E} failed due to the following error: 80040154.
at Microsoft.SqlServer.Dts.Runtime.Application..ctor()

And this the Remote component:

<Serializable()> Public Class SSISComponent

Inherits MarshalByRefObject



Public Function LaunchPackage(ByVal sourceLocation As String, ByVal serverName As String, ByVal packageName As String, ByVal packageVariables As SortedList) As Microsoft.SqlServer.Dts.Runtime.DTSExecResult

Dim packagePath As String
Dim myPackage As Package
Dim integrationServices As New Application
' Combine path and filename.
packagePath = Path.Combine(sourceLocation, packageName)
Try
If integrationServices.ExistsOnDtsServer(packagePath, serverName) Then
myPackage = integrationServices.LoadFromDtsServer(packagePath, serverName, Nothing)
Else
Throw New ApplicationException( "Invalid package name or location: " & packagePath)
End If
If Not packageVariables Is Nothing Then
For Each de As DictionaryEntry In packageVariables
myPackage.Variables(de.Key).Value = de.Value
Next
End If
LaunchPackage = myPackage.Execute()
Catch ex As Exception
Throw
End Try
End Function
End Class

This is the code that call the remote component to run the package on the Server:
Public Class Test
Private Function LoadAndRunPackageRemotly(ByVal PackageName As String, ByVal PackageVariables As SortedList) As Boolean

Dim launchPackageService As New SSISComponent
Dim packageResult As Microsoft.SqlServer.Dts.Runtime.DTSExecResult
Try
packageResult = launchPackageService.LaunchPackage(Me.SSISPackageLocation, Me.SSISServerName, PackageName, PackageVariables)
If packageResult = DTSExecResult.Success Then
LoadAndRunPackageRemotly = True
Else
LoadAndRunPackageRemotly = False
End If
Catch ex As Exception
Throw
End Try
End Function
End Class

I would like to inform that everything run inside a thread because the Package do a lot of things...
When I build up the setup for the exe inside the Detected Dependencies there are several DLL related to SQL Server (Microsoft.SQLServer.DTSRuntimeWrap.dll etc..etc..) that I don't register ..
Tis could be the problem?
If yes, somebody can tell me which one I have to register ? as COM or COMRelativePath?
Some other hints?

This error could be also caused by wrong permissions on the ssis?
Thank you very much for any help...
p.s. To use sql server agent will be my last option!!
Marina b.

View 8 Replies View Related

Cannot Load JDBC Driver Class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'

Apr 14, 2008

I have read similar posts to this, but I am still having problems.

I am trying to use connection pooling to connect to a local SQL Server 2005 database. I am running my application using
MyEclipse Enterprise Workbench. I have verified that sqljdbc.jar resides in "WebRoot/WEB-INF/lib/"

"WebRoot/WEB-INF/web.xml":
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsichemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<resource-ref>
<res-ref-name>jdbc/DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>


"WebRoot/META-INFcontext.xml":

<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="jdbc/DefaultDS"
auth="Container"
type="javax.sql.DataSource"
username="tec"
password="tec"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDrive"
url="jdbcqlserver://localhost:1433/tec;databaseName=tec;user=tec;password=test;"
validationQuery="select 1"
maxActive="10"
maxIdle="2"/>
</Context>

Classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/dom.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxen-full.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxp-api.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jdbc2_0-stdext.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/sqljdbc.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jstl.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/mail.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/sax.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/saxpath.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/standard.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xalan.jar"/>
<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xercesImpl.jar"/>
<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>

Code to connect:

import java.io.Serializable;
import java.sql.*;

import javax.sql.*;
import javax.naming.*;
public int testConnect(){
Connection conn = null;
InitialContext ctx = null;
java.sql.Statement stmt = null;

try {
ctx = new InitialContext();
Context envCtx = (Context) ctx.lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/DefaultDS");/*This is generating the Cannot load JDBC driver class... error*/
conn = ds.getConnection();
stmt = conn.createStatement();
return CONSTANT.SUCCESS;

} catch (Exception e) {
return CONSTANT.FAILURE;
}finally {
try {
if (stmt != null)
stmt.close();
if (conn != null)
conn.close();
if (ctx != null)
ctx.close();
} catch (Exception ex) {
// do nothing
return CONSTANT.FAILURE;
}
}
}

Any ideas would be greatly appreciated.

View 17 Replies View Related

SSIS - On Execute Package Out Of Memory Error

Feb 20, 2007

Hi,

when i am trying to execute package in ssis then given below errors comes many times.how to fix it.any body can ......

in ssis default buffer size 10 mb.

soure is iseries-db2 on as400 in production server ,

and destination is db2 udb on windows in dev server.

usersapce page size in db2 is 16-32k

4 gb ram support in server with 2003 server standard edition.

errors are---

Information: 0x4004800D at CHDRPF 312-315, DTS.Pipeline: The buffer manager failed a memory allocation call for 15728400 bytes, but was unable to swap out any buffers to relieve memory pressure. 3 buffers were considered and 3 were locked. Either not enough memory is available to the pipeline because not enough are installed, other processes were using it, or too many buffers are locked.
Error: 0xC0047012 at CHDRPF 312-315, DTS.Pipeline: A buffer failed while allocating 15728400 bytes.
Error: 0xC0047011 at CHDRPF 312-315, DTS.Pipeline: The system reports 83 percent memory load. There are 3488509952 bytes of physical memory with 558743552 bytes free. There are 2147352576 bytes of virtual memory with 222920704 bytes free. The paging file has 7416537088 bytes with 3703283712 bytes free.
Error: 0xC0047056 at CHDRPF 312-315, DTS.Pipeline: The Data Flow task failed to create a buffer to call PrimeOutput for output "DataReader Source" (15437) on component "DataReader Output" (15442). This error usually occurs due to an out-of-memory condition.
Error: 0xC0047021 at CHDRPF 312-315, DTS.Pipeline: Thread "SourceThread0" has exited with error code 0x8007000E.
Error: 0xC0047039 at CHDRPF 312-315, DTS.Pipeline: Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.
Error: 0xC0047021 at CHDRPF 312-315, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0047039.



so what need to do for fix that problem ......

View 10 Replies View Related

Class Method Is Smoking Fast When Executed Outside Of SQLServer, Dog Slow As A CLR Function Is SQLServer - Anyone?

May 10, 2007

We have a static class that makes an HTTPWebRequest to get XML data from one of our vendors. We use this as input to a stored proc in SQLServer2005. When I compile this class and call it from a console application in visual studio it executes in milliseconds, everytime. When I compile it, create the assembly and clr function and execute it in SQLServer, it takes around 14 seconds to execute the first time, then on subsequent requests it is again really fast, until I wait for 10 seconds and re-execute, once again it is slow the first time and then fast on subsequent requests. We do not see this behavior when executing outside SQLServer. Makes me think that some sort of authentication is perhaps taking place the first time the function is run in SQLServer? I have no idea how to debug this further. Anyone seen this before or have any ideas?



Here is the class:






Code Snippet

using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace Predict.Services
{
public static class Foo
{
public static string GetIntradayQuote(string symbol)
{
string returnQuote = "";

HttpWebRequest request = (HttpWebRequest)(WebRequest.Create("http://data.predict.com/predictws/detailed_quote.html?syms=" + symbol + "&fields=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,30"));

request.Timeout = 1000;

HttpWebResponse response = (HttpWebResponse)(request.GetResponse());

StreamReader streamReader = new StreamReader(response.GetResponseStream());

returnQuote = streamReader.ReadToEnd();

streamReader.Close();
response.Close();

return returnQuote;
}
}
}



When I run call it from a console app it is fine.



I compile it into a dll and then create the assembly and function as follows:






Code Snippet

drop function fnTestGetIntradayQuoteXML_SJS

go

drop assembly TestGetIntradayQuoteXML_SJS

go

create ASSEMBLY TestGetIntradayQuoteXML_SJS from 'c:DataBackupsCLRLibrariesTestGetIntradayQuote_SJS.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS

go

CREATE FUNCTION fnTestGetIntradayQuoteXML_SJS(@SymbolList nvarchar(max)) RETURNS nvarchar(max) AS EXTERNAL NAME TestGetIntradayQuoteXML_SJS.[Predict.Services.Foo].GetIntraDayQuote

go



declare @testing nvarchar(max)

set @testing = dbo.fnTestGetIntradayQuoteXML_SJS('goog')

print @testing





When I execute the function as above, again, really slow the first time, then fast on subsequent calls. Could there be something wrong with the code, or some headers that need to be set differently to operate from the CLR in SQLServer?



Regards,



Skipper.

View 1 Replies View Related

Memory Leak?

Mar 30, 2005

Hello all,

I have recently encountered what looks like a memory leak within SQL server, but may be a number of other things as well - I'm hoping that some of you may have encountered this problem as well so I may be able to narrow down my list of possible culprits.

I noticed this morning that SQL Server was chewing up about 1.5 GB of memory - obviously way more than it should be. At first, I thought this may be because of a coding error, but I was unable to reproduce the problem on my development machine (running SQL Personal).

After re-starting the SQL service (which cleared up the memory use), I ran task manager on our SQL server machine, and noticed that when queries were executed (especially queries that returned fairly large recordsets), memory consumption used by the sql server process would jump up, but then would not be released (as my development machine was doing).

I'm not a DBA, so I'm hoping this may be happening because of some (unknown to me) option that is not currently enabled/disabled on the SQL Server. My only other thoughts at this time are that maybe it's a bad install of SQL, or perhaps bad RAM? Any supporting/disproving thoughts? Any similar situations?

Any help with this would be greatly appreciated.

Thank you in advance,
AtomicChip

View 2 Replies View Related

70 Memory Leak

Oct 26, 1999

We are running 2 SQL 7.0 servers which have IIS 4 also installed. The servers are mirror images
of each other and are configure the same(1 is test, the other is a production server) I have noticed that even if no one is on the production server the memory being used will peak
at almost 100% of the physical memory and peg the CPU at 35-40%. If I shut down the SQL server
or reboot NT altogether the memory used will start to be fairly close to the test server. It seeds
to take almost a week for this to happen again but it looks like a memory leak. Has anyone else
seen this?

View 1 Replies View Related

Memory Leak With SQL 7.0

Oct 18, 1999

I am running Back Office Server 4.5 service pack 5 and I have a memory leak with SQL 7.0. Anyone have any ideas?? I have a feeling it is related to having IIS 4.0 and SQL 7.0 on the same machine.

View 2 Replies View Related

Memory Leak

Jan 3, 2000

What is the best way to determine if there is a "memory leak" in
VB or stored procedures that is using SQL as the back end??

View 1 Replies View Related

70 Memory Leak

Oct 26, 1999

We are running 2 SQL 7.0 servers which have IIS 4 also installed. The servers are mirror images of each other and are configure the same(1 is test, the other is a production server)
I have noticed that even if no one is on the production server the memory being used will peak
at almost 100% of the physical memory and peg the CPU at 35-40%. If I shut down the SQL server
or reboot NT altogether the memory used will start to be fairly close to the test server. It seeds
to take almost a week for this to happen again but it looks like a memory leak. Has anyone else seen
this?

View 2 Replies View Related

SQL Memory Leak?

Oct 21, 1999

Hi Everyone,
We have a SQL server 6.5 machine that appears to be melting down. If I monitor the SQLSERVR process in Task Manager, I see the memory usage continue to climb. The number of threads and handles for this process also continue to climb. I am not able to see in SQL current activity what tasks might be doing this.
Does anyone have any idea on ideas to troubleshoot this? The SQL server supports an Intranet application that connects to it from IIS via ODBC.

Thanks in advance,
Ed

View 1 Replies View Related

6.5 Memory Leak

Jul 13, 1999

I am stumped on a apparent memory leak in SQL Server 6.5.

I am running a NT Server 4.0 with SQL Server 6.5sp3 and Cold Fusion Server
4.0. The database is used in tandem with CF4.0 to drive a website that
offers a meeting search utility. The LIVE server has been experiencing
enormous reductions in speed in the last week (the site has only been live
for about 9 days). When the server was stopped/restarted the problems would
disappear temporarily only to resurface within 1/2 hour.

On closer inspection of the of the Process tab in Task Manager SQLSERVR.EXE
' s Mem Usage climbs at a steady rate until it is utilizing so much of the
available memory that the Cold Fusion Server process ends up pegging out
(suspect because of forced page faults due to lack of memory resources?)
which in turn slows the entire website down to a crawl. Even after the
scripts have finished executing and SQLSERVR.EXE 's CPU% is 0 the memory
that was allocated during processing is not released.

I have a NT Server 4.0 development server running SQL Server 6.5sp5a and
CF4.0. I tried running same scripts on it as the live server and sure
enough found the same scenario.

I also have a NT 4.0 Workstation here at home which has SQL Server 6.5sp5a
and CF4.0. I have the DB replicated here. I can not reproduce the error on
this machine running the very same scripts that are being run against the
other two.

Any help/direction would be GREATLY appreciated!

Bryan Ziel

View 2 Replies View Related

Possible Memory Leak In CF 2.0 App?

Nov 6, 2007



I have a CF .Net 2.0 SP2 app that I *think* is leaking memory. My application has a dozen or so forms, uses two compact flash cards (one for a custom radio and the other for a GPRS internet connection). We have both SQL CE 3.0 data files and xml files that are written to. And we are using log4net as our logging library. For communication with our custom CF card, we use the .NET SerialPort class. For GPRS communication we use HttpWebRequest class.



I've built a special test version of my app that accelerates the normal usage....basically accessing both CF slots continually, and showing a couple different forms.



After four or five days of my test app (which is about a year of real world usage), I see our SQL CE commands failing with "Not enough storage is available to complete this operation".



I've added some logging of the current memory using a p/invoke to GlobalMemoryStatus. What I see is that the MEMORYSTATUS dwAvailVirtual and dwAvailPhys are slowing decreasing over time, and when dwAvailVirtual reaches about 1 MB I start seeing the above errors.


I've started pulling things out of the app and still see the behavior. I've completely removed SQL CE and log4net and the same result happens.


I've done some profiling with .NET 2.0 SP2's Remote Performance Monitor, and what I see is that in a four hour test, the "Managed Bytes in Use After GC" and "Total Bytes in Use After GC" are not steadily going up. I see them fluctuate around the same levels. The heap snapshots are not showing me any red flags yet either. I see object counts going up and down over time. But in this same time period, I see that the values reported by GlobalMemoryStatus are gradually going up (about 1.5 MB more at the end of the test than the start). If I continue this test it eventually eats up all virtual memory in about 24 hours.

I'm going to continue pulling my application apart to narrow the problem down, but wanted to know if anyone out there has encountered similar behavior, and if you have, what did you find? Any ideas or tips on how to narrow this one down faster would be much appreciated.

Thanks!

View 1 Replies View Related

Memory Leak

Sep 2, 2006

Dear Support,

I have a website based on ASP which is stored within an SQL database, however I appear to be experiencing a memory leak.

I'm running Windows Server 2003 x64 SP1 and MS SQL 2000 SP4.

The process which is consuming all my memory is sqlservr.exe *32. The process when restarted is about 27MB in size and will quickly reach 150MB or more until my server has no more memory.

I have little knowledge of MS SQL, however from what I've read, SQL by default is designed to use as much memory as possible, but not to the extent that it kills my server. By stopping and starting the sqlservr.exe *32 process memory is restored. I've scheduled a batch file to do this every morning at 5am as a temporary workaround. If this batch file didn't run, eventually I get the error message "HTTP/1.1 New Session Failed" when visting my website. Through my server web tools I'm forced to reboot my server which restores functionality of my site. I have also tried editing the way SQL handles memory in the Enterprise Console to a fixed amount of 118MB. I restarted my server, yet after two days the sqlservr.exe *32 process was using more than the set amount.

How can I trace the source of the problem? It's been mentioned to me open database connections may be causing the leak. How can I verify this step by step?

Many thanks - Mike

View 4 Replies View Related

Memory Leak?

Nov 19, 2007

I believe that I may have a memory leak. I loaded a job into a scheduling engine and had it run every 15 minutes over the weekend. It ran successfully everytime untill sunday mid-day. That is when I started getting memory issues.

OnError,BPATLQDDW,NT AUTHORITYSYSTEM,Populate Flat Files,{B9F25310-0573-4042-A3DB-D0AEFD89D64C},{04378062-78CB-465B-8AD0-05E048269768},11/19/2007 10:05:58 AM,11/19/2007 10:05:58 AM,-1073450990,0x,A buffer failed while allocating 6485064 bytes.

I also get this error:

OnError,BPATLQDDW,NT AUTHORITYSYSTEM,Populate Flat Files,{B9F25310-0573-4042-A3DB-D0AEFD89D64C},{9E929349-B0FE-4EBB-A353-EC61805B4C3C},11/18/2007 8:16:16 PM,11/18/2007 8:16:16 PM,-1073450991,0x,The system reports 91 percent memory load. There are 3925336064 bytes of physical memory with 341479424 bytes free. There are 2147352576 bytes of virtual memory with 218148864 bytes free. The paging file has 8057835520 bytes with 4688982016 bytes free.

Are there any known issues with memory leaks that may be causing this? Does anyone have any suggestions? I have allready attempted to adjust the size of my default buffer.

View 6 Replies View Related

Do I Have A Memory Leak

Apr 30, 2008

Hi,

I've encountered a problem regarding a buffer allocation failure whilst running a SSIS package. The package gets a recordset of values and then for each value it iterates through a for loop. Within the for loop it simply performs 5 data pumps, collecting data into staging tables and the processes the data. The staging tables are then cleared down and the loop restarts.

In the instance when we had the allocation failure we had an abnormally large number of values for which to iterate through the loop, which is why I think we don't generally see this problem.

I've been reading around an there are suggestions that there is a memory leak issue when using a for loop and this seems to tally with what I'm seeing.

Can anyone confirm that this is a problem and whether this has been fixed in any Service Packs.

We are currently running on 2005 9.00.3042.00 (32bit) - Standard Edition on Windows NT 5.2 - Service Pack 2

Thanks in advance for any information.

Regards,

Ian

View 5 Replies View Related

Memory Leak? And Dates....

Jan 4, 2000

Hi
I have recently installed SQL Server 7
I'm an NT and SQL newbie, so be gentle...
After 2 or 3 days the memory used by SQL is up in the 190MB region from 100MB startup (the actuall app database is still tiny) and NT comes up with a 'run out of virtual memory' error/message.
Why is SQL bloating? I'm not exactly doing much with it, and my DB apps are closing down properly (no recordsets / connections left open).
Help help help!

Also, if I have a date in a string format, whats the easiest way to get SQL to compare it to a date type in a where clause???? :-)

Thanks all.

PIII 256MB NT Server 4 option pack 4 service pack 4

View 3 Replies View Related

DTS Memory/handle Leak

Sep 2, 2004

I have saved a DTS package as a vb module (.bas) file and created and activex dll from it. When i use this dll in another program and watch the handles and memory usage of the process using task manager the handles and memory values keep increasing with every call to the DTS package. memory does not increase if the dts package has not been called.

I am using sql server 2000 and visual studio 6.0 (sp 4)

View 2 Replies View Related

Best Place To Look For Memory Leak

Jun 21, 2001

Last 2 nights (at night) my SQL Server has locked up, first night trying to back up MSDB(20 meg) and last night ran out of memory at 6:30 AM. No users on at either time, no jobs running on the second night. I was going to turn perfmon on tonite. Any input on what best to monitor?

View 2 Replies View Related

SQL Server Memory Leak

Mar 20, 2006

I was doing a quick test with SQL Server Express and noticed that there is memory leak

Here is the pseudo code

do loop //1000 times
{
1. Open connection to the database
2. Build SQL statement
3. Construct SQLDataAdapter
4. Fill DataSet using ( adaptor.Fill(dataSet); )
5. Close connection to the database
6. Dispose whatever is disposable
}

When I ran this test I saw that SQLServer service memory usage is going up and never released

Is there something that I am doing wrong. If I ran same test against Access database then there is no problem

Thanks

View 1 Replies View Related

Memory Leak In SQL Server

Jul 23, 2005

I have a stand alone Java application that uses MS SQL Server 2000 andMicrosoft JDBC ODBC drivers to access it. Before I run the application,I open the task Manager to monitor the memory used by the SQL Server.Generally it begins 21 MB and very soon it reaches around 100 MB if Ido some operations in the application. The thing is that even if Iclose the application, the memory taken by SQL Server doesn't go down.What could be the reason behind it? Java code or MD drivers or SQLServer?I checked the code and we are closing the statements and result set andcommiting everywhere.Please let me know...I am trying to refactor as much as I can but stillout of luck.

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved