I do a HeapFree everytime. Actually I am running this on a Grid environment with 1000's of items and each item is memory intensive and each item sometimes goes beyond 1.5 GB. But after every run the memory comes back to 60 mb or so. I will try whatever you said. Thanks again for all the valuable information.
miah alom
Posts
-
HeapAlloc -
HeapAllocSometimes I have to allocate more than 500 MB of data. In such situations I run into OutOfMemoryException. The real problem here is a third party API I am using expects string as an input parameter which can sometimes be as large as 800 MB. That why I am using HeapAlloc. HeapAlloc has worked fine for me so far without any problems.
-
HeapAllocSorry if this bothered you. Since there was some C++ involved in the problem so I posted this question.
-
HeapAllocThanks a lot for the reply. I will try and see if it works.
-
HeapAllocHi, I have an application in C# which allocates 200MB of data from the unmanaged heap using the [DllImport("kernel32")] static extern void* HeapAlloc(int hHeap, int flags, int size); I have another fucntion [DllImport("cppwrapper.dll")] private extern static int test(IntPtr DataOut, out string ErrorOut); I want to pass the the pointer returned by HeapAlloc into the test function using the parameter DataOut instead of string as I run into OutofmemoryException randomly(There is a limitation on the managed heap). But I am constantly getting the system.accessviolation exception. The body of test method looks like SOME_API int test(LPSTR* DataOut, LPSTR* ErrorOut) { return _lpsomefunction(DataOut, ErrorOut); } Can someone guide me in the right direction...
-
SQLSimply run the update command. Below is a sample. CREATE TABLE dbo.ctm ( id numeric(18,0) IDENTITY, col1 varchar(20) NULL, col2 varchar(20) NULL ) go INSERT INTO dbo.ctm ( col1, col2 ) VALUES ( 'aa', 'bb' ) INSERT INTO dbo.ctm ( col1, col2 ) VALUES ( 'cc', 'dd' ) SELECT T.id, T.col1, T.col2 FROM dbo.ctm T update ctm set col1 = col2, col2 = col1 SELECT T.id, T.col1, T.col2 FROM dbo.ctm T
-
Ado.net sqldatareader not workingCheck this out. http://www.sitepoint.com/article/asp-net-repeater-control
-
Ado.net sqldatareader not workingYou cannot bind DataReader to the Winform DataGrid. This is possible in ASP.NET though. So please bing the DataGrid to a DataSet instead. Q313482 INFO: Roadmap for Windows Forms Data Binding http://support.microsoft.com/support/kb/articles/q313/4/82.asp
-
Help - I'm a Novice - SQL Query Problemright.
-
Help - I'm a Novice - SQL Query ProblemAsuuming all are varchar or char(n) select FirstName + ' ' + LastName + ' ' + MiddleName + ' ' + City + ' ' + State from yourtable.
-
trace the computer nameI have solved this problem in a different way. When the user logs in to the application, I insert the kerberos user id and the hostname in a Activity table. But there is a limitation. One user cannot start two instances of the application from the same host. So when there is a update or delete or insert, I pick up the value from this table. Everytime the user logs in, I clear the Activity for that user in a host machine. CREATE PROCEDURE ValidateUser ( @userid varchar(10) ) AS DECLARE @cnt int BEGIN DELETE FROM Activity WHERE Host = host_name() INSERT INTO Activity VALUES(host_name(),@userid) SELECT @cnt = count(*) FROM Users WHERE ID = @userid IF @cnt = 1 SELECT 1 ELSE SELECT 0 END In the trigger I do something like IF @@rowcount = 0 RETURN SELECT @user = CurrentUser FROM Activity WHERE Host = host_name() IF UPDATE(Column1) INSERT INTO AuditTrail SELECT @user,getdate(),'Table1','Column1' --blah blah FROM deleted,inserted WHERE ------------------- Does this help.
-
To access and print the values in Hashtable?Does it help IDictionaryEnumerator en = h.GetEnumerator(); while (en.MoveNext()) { Console.WriteLine(en.Key + " : " + en.Value); }
-
WinForms User Control in VB6 AppYou should be looking for tlbexp.exe. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfTypeLibraryExporterTlbExpexe.asp[^]
-
trace the computer nameI think you are looking for HOST_NAME() http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ha-hz_05r9.asp[^]
-
dataset getchanges() questionAgreed. Please call DataRow.Delete() instead.
-
Drag Drop within a ControlI am looking for a way to drag-drop regions inside a Panel. Can somebody please point me to the right direction.
-
Sorting a ArrayList on multiple fieldsExactly. Thanks. I am such a dumb. Anyway thanks for your help.
-
Sorting a ArrayList on multiple fieldsI am looking for a way to sort an ArrayList on Multiple fields similar to the following. eg. select * from table1 order by col1 desc, col2 asc, col3 desc. I have implemented the IComparer for the different fields. I am not sure how to go forward from here. I am trying to achieve best performance.
-
ExecuteNonQuery problemsYou need to change the CommandTimeOut. That might work. 1.Public Function ExecuteSQLCommand(ByVal strSql As String) As Integer 2. InitializeConnection() 3. If con.State = ConnectionState.Open Then con.Close() 4. con.Open() 5. cmd = New SqlCommand() 6. cmd.Connection = con 7. cmd.CommandTimeout = 60 8. cmd.CommandType = CommandType.Text 9. cmd.CommandText = "delete from d where id > 10" 10. Return cmd.ExecuteNonQuery() 11. End Function
-
Joining TablesIf you want the resultset independent of the FCV_DATE column just remove it from the where clause. Since there is no column with FCV_Date='10/14/2005' you get an empty resultset.