|
I have a Windows Service running in the same server as SQL Server. This service uses lot of resources (basically memory). The problem is that at some point, SQL Server uses almost all the available memory in my server. The service runs a memory intensive process from time to time, and I constantly receive an "OutOfMemory" exception (sql server is not leaving much available memory for my service to do its tasks). My service needs about 20MB of free memory, and my question is: Is there any way to pre-alocate this amounth of memory to my service. I mean... not really "allocate" the memory, but "reserve" the memory.
Maurício Ritter
Mauricio Ritter - Brazil
MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
There is a spelling error in your spelling error disclaimer. It is "errors" not "erros" (eros? )
SCNR
|
|
|
|
|
And now for something useful:
Basically, .NET takes Memory Management out of your hands (GC-wise), so you can simply hack away.
If I was you, I wouldnt want to lose that ability.
I am not sure about .NET, but in Suns JAVA-VM you can specify how much memory you need and the Runtime would then reserve it.
This is one way you could go (that is, IF .NET has similar functionality). The other way would be limiting the SQL-Server to a certain amount of memory (if possible).
The third (and slowest way) would be try/catching each memory-affection operation and then retrying (with a 20ms sleep, maybe) until you get your operation completed (I understand that the memory-consuming allocations of the SQL-Server are peaks only).
There may be more solutions, but the above are all I can think of.
Before I forget, there also are 2 non-programmatical solutions to your problem:
1st - let Windows handle the page file or set it to something bigger (e.g. 1 GB)
2nd - upgrade your server (more physical RAM)
Cheers
Sid
|
|
|
|
|
You can set SQL server to a maximum memory usage, otherwise it just uses memory until the server starts paging. Increasing the page file should fix the problem as well, but then you would be causing the server to page which is a bad thing for performance.
Better would be to move your process off the SQL server, or find a different algorithm.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hi,
I am creating a design environment so that my users can design certain elements of the program themselves. To do this I require the use of the PropertyGrid control. The elements that I am letting to the user change are sub classes of the Control object. The problem I have is the attributes that the PropertyGrid displays. When I set the SelectedObject of the PropertyGrid to my own element it shows all the attributes for the Control class as well as the elements class.
With this design tool being used by users, I don't want them to see attributes like AllowDrop etc...
How can I suppress some of these attributes and events?
Regards
Chris Mitchell
|
|
|
|
|
Hi ,
i am using vbscript to open word document in my web page.(web page
is written in c# )
The code snippet in below. This code is doing what i want.
however when i try
to go back opener page with internet explorer "Back" button this
function is working again and word document is opening so i could
not open my page again.Is there any solution to unregister or block
this script...
string redirect = "c:/NewFolder/xxx.doc";
script = ""
+ " window.location=\"" + redirect + "\""
+ " ";
Page.RegisterStartupScript("__JS_OPENFILE",script);
thanks..
|
|
|
|
|
hi,
i want to create baloon tips which give hints about elements in a html page, like the ones which pop up on the taskbar to say that new updates are available etc. i'm accessing the html document through a iwebbrowserapp object. my created baloon tips should also not disable the focus of the html page. the user has to be able to click on the baloon tip (e.g. to let it disappear) or on an element within the html page.
can anyone give me some hints how to realize this?
thanks for help.
pikebu
|
|
|
|
|
Hi,
I have a DataGrid full of data which I would like to print. The columns and data are different depending on what query is run by the user. What way can be used to get this data into a printpreview screen to print or just print it straight to the printer?
Thanks for any help.
regards,
Stephen McAllister
|
|
|
|
|
Hi,
Guess the followinf link will help you.
http://www.c-sharpcorner.com/Graphics/DataGridPrinterMG.asp
Thnaks
SGS
|
|
|
|
|
Dear members,
This is not a specific tec doubts. This all about your experience and your way of dealing the issue.
Brief idea:
We have an application which uses Sybase database as Backend and Dotnet( C# Lan) as Front-End. This application uses IAnywhere.Data.AsaClient.dll (managed provider for Sybase db). This application is a small supporting module for our ERP which is developed using Power Builder.
Real requirement.
Now we are deciding to make this application as a pluggable for our ERP and also can plugged into other ERPS or applications, which have raw data needed to run our pluggable application.
Here the raw data ( data required to run this pluggable application ) may be in different database ( Db2,Sql Server,Oracle,Sybase etc). But now we don't have any interface or mechanism to pull the data from other Databases into my data base with required form (field name and data types).
What will be the better solution to make my product as pluggable for other application. ?
What is the real industry standard to tackle this sort of scenarios. ?
If you need to face this issue, what you will prefer to get out of this ?
How will i make a Data Pipe kind of mechanism to get required data in required form from other databases ?
Please do comment for this query. Your post will be most appreciable.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
My teacher give me a project ,it is "use .net to implement internet message board ,it includes the implement of the server ,the implement of the client...",mine is the implement of the client ,I just want to know where to start,my teacher said like the chat room is one of the example ,could somebody tell me where to start ,many many thanks
|
|
|
|
|
|
OK, lets have a look at your problem:
Implementation of information exchange over TCP/IP.
First, there are 2 types of participants in this system: The Server (which stores all data and provides clients with the necessary information) and the Client (which displays data to the user and allows users to send information to each other).
Thus, this is called "Client-Server-Architecture".
First, you need to specify what your client should be able to do. Are you implementing a chat-system (near realtime) or a message board (not realtime).
Second, you need to specify HOW data is transferred from the client to the server and vice-versa.
This really is up to you. for a simple chat system, this would be something like:
Client-to-Server: nickname, flags (color, bold or whatever) and message.
Server-to-Client: timestamp, nickname, flags, message
The Client would be running a UI with 2 threads: one sending thread and one listening thread, where the sending thread transmits everything from an input-field when ENTER is pressed and the receiving threads listens for messages from the server and updates a chat-window accordingly.
The Server would simply have an array of sockets to his clients and forward every arriving message to every client (or specific clients, if there is a "private chat" included), stamping each message as it arrives. You could call that "mixing", as the server arranges all messages by their arrival timestamp.
With a message board, you also will have to think about retrieving only certain messages (in order to preserve bandwidth) and how to authenticate yourself at the server.
Of course, this is just my opinion.
Cheers
Sid
|
|
|
|
|
hi all,
i need to view a html(say abc.html) in my form and compare it to another html . both these should be placed side-by-side. i need to add synchronized scrolling to these.
any inputs?
thanks
|
|
|
|
|
After hours of googling, i concluded... it is NOT possible to set a custom paper size through the pagesettings class. (i mean printdocument.defaultpagesettings.papersize = new papersize(...) )
Please correct me if i'm wrong!!
(PD: i've found lots, and i mean lots of posts in many web sites about this ... wow ... nobody can set a new papersize? I tested this in vb 6.0 and i CAN do so in three lines of code, but seems impossible to do in C#)
|
|
|
|
|
itis not a bug reflex cuz it is so easy but hiding some much
it is in PaperSize property in the PrinterSettings.PaperSizes Collection
and in only one line of code
ByMindOnlyYouCanDoIt
|
|
|
|
|
1) Via PrinterSettings.PaperSizes you cannot add a CUSTOM PaperSize (You CAN do so in .NET Framework 2.0, BUT, it has the SAME BUG!!!)
2) Via DefaultPageSettings.PaperSize you CAN create a custom PaperSize, BUT it is NOT used on the printer...
|
|
|
|
|
I was reading the article C# Server Enumerator By Phil Bolduc
because I am trying to figure out how to build a database connection dialog for an application that should be flexible about which database server and which database I connect to.
My problem is that the sampe code does not run....
If there is a Network Managment namespace somewhere, I don't know where to find it.
I realized this snippet was not comlete because there was no main method, but that is not all that is wrong. Can anybody point out where I am going wrong?
// His code here...======================================================
using System;
using NetworkManagement;
//
// List all the SQL Server database to the
// console (using foreach)
//
Servers servers = new Servers( ServerType.SQLServer );
foreach (String name in servers)
{
Console.WriteLine(name);
}
//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()
while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
// My code here... ==========================================
using System;
using NetworkManagement;
namespace ConsoleApplication2
{
///
/// Summary description for Class1.
///
class Class1
{
Servers servers = new Servers( ServerType.SQLServer );
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
//
// List all the SQL Server database to the
// console (using foreach)
//
foreach (String name in servers)
{
Console.WriteLine(name);
}
//
// List all the Domains to the console.
//
Servers servers = new Servers( ServerType.DomainEnum );
IEnumerator i = servers.GetEnumerator()
while ( i.MoveNext() )
{
string domainName = (string) i.Current;
Console.WriteLine(domainName);
}
}
}
}
|
|
|
|
|
|
hi
i create a web application with c# and use code behinde.
its now on my desktop computer and i want to deploy it to my web site.
How i can do it?
|
|
|
|
|
Hi,
You can deploy it by copying the .dll and the content files into correct folder. Or else we can create Web Setup project for deploying the web application.
http://www.15seconds.com/issue/030806.htm Gives you more information on this.
Thanks
SGS
|
|
|
|
|
#1: Does this server support .NET apps (does hit host it, many providers ask for payment for apps).
#2: Does the server has IIS installed, if not, forget it.
#3: if all OK, upload the content files and the dll's (in the bin directory) to the server (keep the directory structure)
#4: Create a virtual folder on IIS and link it to the folder where you copied your app.
#5: now you should be able to surf to the page.
No hurries, no worries.
|
|
|
|
|
When I add items to a ListView control and the amount of items exceed the size of the control a vertical scroll bar appears (I have set scrollable to true and this is what I want). My question is when I continue to add items the ListView control adds the new item at the end of the control (as it should) however the ListView control always shows the items that were entered first. That is I have to use the mouse to drag the scroll bar to see the last entry. Is there a way to program the ListView control so when it adds a new item you see the new item at the bottom of the ListView control without manually dragging the vertical scroll bar?
Thanks
|
|
|
|
|
I guess when you try all day and finally decide to go to the message boards you find the answer.
There is a public Method (EnsureVisible) that will auto scroll the ListView if necessary to make visible the ListView Item of your choice:
lstVwResults.Items[lstVwResults.Items.Count - 1].EnsureVisible();
The above code will ensure the last item added to the ListView control will be displayed.
|
|
|
|
|
I have writen a dll in VC++ project. how can I call the function in the dll from a C# console project?
I think there must be a way. I just don't know how to do it. BTW, I am newbie of C#. I use Visual Studio .Net.
Thank you.
|
|
|
|