#1 2018-02-03 21:21:31

pony5551
Member
Registered: 2018-01-24
Posts: 9

SyNode cannot be used in the ISAPI

Why use SyNode in the ISAPI to Create the Create runtime: out of memory?
But SM24 doesn't.

MyCode

procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  fEngineManager := TSMEngineManager.Create('');
  try
    fEngine := fEngineManager.ThreadSafeEngine(nil);

    Response.Content :=
      '<html>' +
      '<head><title>Web Server Application</title></head>' +
      '<body>Web Server Application</body>' +
      '</html>';

      fEngineManager.ReleaseCurrentThreadEngine;
  finally
    fEngineManager.Free;
  end;
end;

Offline

#2 2018-02-03 21:23:16

pony5551
Member
Registered: 2018-01-24
Posts: 9

Re: SyNode cannot be used in the ISAPI

error code is

  frt := PJSRuntime(nil).New(FManager.MaxPerEngineMemory, $01000000, nil);
  if frt = nil then
    raise ESMException.Create('Create runtime: out of memory');

frt is nil

Offline

#3 2018-02-04 07:58:46

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,074
Website

Re: SyNode cannot be used in the ISAPI

I think your ISAPI thread pull is too large. In any case create a new engine manager and engine for every request is overhead.  SyNode engines creation is slow,  because we consider it should be created only once per thread, not per request as in your sample

Offline

#4 2018-02-10 16:01:32

pony5551
Member
Registered: 2018-01-24
Posts: 9

Re: SyNode cannot be used in the ISAPI

Thank you. If you create an engine in advance, you might want to create an object pool.

Offline

Board footer

Powered by FluxBB