Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crash due to memory leak when selecting many (small or empty?) blob fields [CORE5342] #5617

Closed
firebird-automations opened this issue Sep 1, 2016 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Frank Schlottmann-Goedde (fsg)

Duplicates CORE5289

Attachments:
c5342_with_logging_of_fb_memory_consumprion.7z
core-5342.zip

My former employer (Assfinet) encountered a server crash when trying to upgrade an existing application to Firebird 3.0.
The engine slowly consumes all available memory until it finally fails with:
FRANKS-E520VM Tue Aug 30 13:17:26 2016
unable to allocate memory from operating system
FRANKS-E520VM Tue Aug 30 13:20:39 2016
Operating system call MapViewOfFile failed. Error code 8
FRANKS-E520VM Tue Aug 30 13:20:40 2016
MonitoringData: Cannot initialize the shared memory region
operating system directive MapViewOfFile failed
unknown Win32 error 8
...

The engine keeps running and the only way to get it back to work is to kill the process (usually restarting the service won't work).

The original reporter claims that the failure also occurs with a 64-bit engine, but I could only reproduce it with the 32-bit engine.

The following scripts demonstrates the failure on a standard Firebird 3.0 32-bit superserver installation under Window 64-bit:

====== Test Details ======

Need lot of time for checking memmory leak.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Looks like a duplicate for CORE5289. I see a small but progressive memory leak in v3.0.0 but after applying patch for CORE5289 I don't see the leak anymore. So it's worth testing v3.0.1 snapshot, the issue appears to be fixed there already.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

I've created this test and add watching for memory consumption by firebird process (using pslist.exe utility from SysInternals package).
Test is currentlyrunning on WI-V3.0.1.32594, 32 bit, SuperServer, config:

RemoteServicePort = 3333
Servermode = Super
MaxUnflushedWrites = -1
MaxUnflushedWriteTime = -1
ExternalFileAccess = Restrict C:\MIX\firebird
TempDirectories = c:\temp
MaxUserTraceLogSize = 99999
FileSystemCacheThreshold = 65536K
AuthServer = Legacy_Auth,Srp
AuthClient = Legacy_Auth,Srp,Win_Sspi
WireCrypt = Disabled
UserManager = Legacy_UserManager
DeadlockTimeout = 1
UdfAccess = Restrict UDF;C:\WINNT\system32

How long should it last (I mean: after what time I can stop it after start) ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

No memory leak detected during > 8 h testing.
See attached .7z for test and its log (file 'memowatch.log')

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: c5342_with_logging_of_fb_memory_consumprion.7z [ 13012 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Frank Schlottmann-Goedde (fsg)

It took 3 to 4 hours in my environment.
I tested it again with WI-V3.0.1.32596, 32 bit, SuperServer, the memory leak doesn't occur anymore.

So, this issue can be closed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue duplicates CORE5289 [ CORE5289 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Duplicate, resolved in v3.0.1.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Cannot be tested

Test Details: Need lot of time for checking memmory leak.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Put scripts in attachment.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Attachment: core-5342.zip [ 13550 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant