Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


IB server is taking too many resources!

IB server is taking too many resources!

IB server is taking too many resources!

Hey Everyone

I've created a program that rebuilds a corrupt database. The program works perfectly but when the rebuild has completed, I press alt-ctrl-del, and find that IBServer is utilising over 100MB of resources, this causes the system to be very sluggish. If I disable the server in control panel and then restart it, my problem is solved, but I'd like the process to be more automatic. Is it possible to restart the IBserver programatically in Delphi. Any suggestions would be helpful!


RE: IB server is taking too many resources!

Not sure if this is the correct approach to solving problem (maybe better to see why its consuming so much resources in the first place) but here is some code to start the Interbase Service programitically :

*  S t a r t S e r v e r ( )
*  Author: The Client Server Factory Inc.
*  Date:   March 1, 1999
*  Input:
*  Return:
*  Description:
* Revisions:
Function StartServer(): boolean;
  lRegistry: TRegistry;
  lStartUpInfo: STARTUPINFO;
  lEXEName: String;
  lArray: Array[0..255] Of char;
  result := False;
  lRegistry := TRegistry.Create;
    Screen.Cursor := crHourglass;
    lRegistry.RootKey := HKEY_LOCAL_MACHINE;
    If Not lRegistry.OpenKey('Software\Borland\InterBase\CurrentVersion',
False) Then
      ShowMessage('InterBase server is not installed on your system.')
      lEXEName := Format('%s%s -a', [lRegistry.ReadString('RootDirectory'),
    ZeroMemory(@lStartUpInfo, SizeOf(lStartUpInfo));
    lStartUpInfo.cb := SizeOf(lStartUpInfo);
    lSecurityAttr.nLength := SizeOf(lSecurityAttr);
    lSecurityAttr.lpSecurityDescriptor := Nil;
    lSecurityAttr.bInheritHandle := True;
    If CreateProcess(Nil, StrPCopy(lArray, lEXEName), @lSecurityAttr, Nil,
      False, 0, Nil,
      Nil, lStartUpInfo, lProcessInfo) <> Null Then
      result := True
      ShowMessage('The server could not be started.')
    Screen.Cursor := crDefault;

And just 2 other code snippets that may be useful :

*  StopService ( )
*  Author: Unknown
*  Date:   Sept 2003
*  Input:
*  Return: true/False (success)
*  Description: Stops a service on Windows XP/NT/2000

function ServiceStop(aMachine,aServiceName : string ) : boolean;
// aMachine is UNC path or local machine if left empty
  h_manager,h_svc   : SC_Handle;
  svc_status     : TServiceStatus;
  dwCheckPoint : DWord;
  if h_manager > 0 then
    h_svc := OpenService(h_manager,PChar(aServiceName),
                         SERVICE_STOP or SERVICE_QUERY_STATUS);

    if h_svc > 0 then
          while(SERVICE_STOPPED <> svc_status.dwCurrentState)do
            dwCheckPoint := svc_status.dwCheckPoint;

            if(not QueryServiceStatus(h_svc,svc_status))then
              // couldn't check status

            if(svc_status.dwCheckPoint < dwCheckPoint)then


  Result := SERVICE_STOPPED = svc_status.dwCurrentState;

Check if service is already running :

Function IsIBRunning(): boolean;
  If GetWindow(GetDesktopWindow, GW_HWNDNEXT) = FindWindow('IB_Server',
    'InterBase Server') Then
    result := False
    result := True;

As you may guess, this represents code I have found on this issue and is from various sources. You will need to change as you feel necessary.

Hope this helps..


RE: IB server is taking too many resources!

Thanks a million!! I'll give it a try. Even if it doesn't prove useful now, I'm sure it'll come in handy in the future!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close