martonsagi / al-object-designer

AL Object Designer for Dynamics 365 Business Central development
MIT License
40 stars 21 forks source link

Object Designer stucks in "Discovering Objects" #48

Closed elweilando closed 4 years ago

elweilando commented 4 years ago

Object Designer stucks in "Discovering Objects". The system gets slowy. After a couple of minutes visual studio code crashes.

Symbol can be downloaded without problems from server. .alcache will be created and include some json files.

Base Application v 15.1.37881.38071

elweilando commented 4 years ago

Errorlogs from VS Code

console.ts:137 [Extension Host] SyntaxError: /Users/el/develop/BusinessCentral/.alcache/cache_516e96d2fb90da7cb530fb0293a94a78d1fecf8356a10a37238e8d89c6e94d9f.json: Unexpected end of JSON input   at JSON.parse (<anonymous>) at /Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/node_modules/jsonfile/index.js:33:18    at /Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/node_modules/graceful-fs/graceful-fs.js:90:16   at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
t.log @ console.ts:137
extensionHost.ts:203 Extension Host
extensionHost.ts:204 Debugger attached.
37console.ts:137 [Extension Host] SyntaxError: /Users/el/develop/BusinessCentral/.alcache/cache_516e96d2fb90da7cb530fb0293a94a78d1fecf8356a10a37238e8d89c6e94d9f.json: Unexpected end of JSON input at JSON.parse (<anonymous>) at /Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/node_modules/jsonfile/index.js:33:18    at /Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/node_modules/graceful-fs/graceful-fs.js:90:16   at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
t.log @ console.ts:137
log.ts:190  WARN UNRESPONSIVE extension host, 'martonsagi.al-object-designer' took 52% of 5237.192ms, saved PROFILE here: '/var/folders/lh/bqmn029179n5t52whhm4xpfw0000gn/T/exthost-6d9bf9.cpuprofile' Array(7)
38console.ts:137 [Extension Host] SyntaxError: /Users/el/develop/BusinessCentral/.alcache/cache_516e96d2fb90da7cb530fb0293a94a78d1fecf8356a10a37238e8d89c6e94d9f.json: Unexpected end of JSON input at JSON.parse (<anonymous>) at /Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/node_modules/jsonfile/index.js:33:18    at /Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/node_modules/graceful-fs/graceful-fs.js:90:16   at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
t.log @ console.ts:137
extensionHost.ts:203 Extension Host
extensionHost.ts:204 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0x10b956015 node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 2: 0x10b956594 node::Abort() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 3: 0x106b216e7 v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 4: 0x106b21687 v8::internal::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 5: 0x106b64d25 v8::internal::Heap::StartIdleIncrementalMarking(v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 6: 0x106b66479 v8::internal::Heap::StartIdleIncrementalMarking(v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 7: 0x106b62e0d v8::internal::Heap::CreateFillerObjectAt(unsigned long, int, v8::internal::ClearRecordedSlots, v8::internal::ClearFreedMemoryMode) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 8: 0x106b608db v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework] 9: 0x106b6c694 v8::internal::Heap::PromotedExternalMemorySize() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]10: 0x106b6cc3f v8::internal::Heap::PromotedExternalMemorySize() [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]11: 0x106d6a9e6 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]12: 0x106fccdcb v8::internal::RegExpParser::ParseRegExp(v8::internal::Isolate*, v8::internal::Zone*, v8::internal::FlatStringReader*, v8::base::Flags<v8::internal::JSRegExp::Flag, int>, v8::internal::RegExpCompileData*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]13: 0x1075d0d99 v8::internal::compiler::ZoneStats::ReturnZone(v8::internal::Zone*) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]14: 0x9587586793c <--- Last few GCs --->[6064:0x10d113000]   662354 ms: Mark-sweep 1978.3 (2069.6) -> 1970.2 (2073.9) MB, 862.1 / 0.1 ms  (average mu = 0.124, current mu = 0.031) allocation failure scavenge might not succeed[6064:0x10d113000]   663475 ms: Mark-sweep 1988.1 (2080.0) -> 1976.3 (2078.0) MB, 1072.1 / 0.1 ms  (average mu = 0.084, current mu = 0.044) allocation failure scavenge might not succeed<--- JS stacktrace --->==== JS stack trace =========================================    0: ExitFrame [pc: 0x1075d0d99]Security context: 0x15ac8bda0d99 <JSObject>    1: getVsConfig [0x15ac41bc5dc9] [/Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/out/utils.js:~202] [pc=0x9587586793c](this=0x15ac41bc2521 <Object map = 0x15acb0817b59>)    2: /* anonymous */ [0x15ac3ec15b29] [/Users/el/.vscode/extensions/martonsagi.al-object-designer-0.1.4/out/ALObjectParser.js:~100] [pc=0x95875ac9378](this=0x15ac3ec15659...
bootstrap-window.js:213 [uncaught exception]: Error: write EPIPE
onUnexpectedError @ bootstrap-window.js:213
bootstrap-window.js:216 Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:83)
onUnexpectedError @ bootstrap-window.js:216
events.js:177 Uncaught Error: write EPIPE
    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:83)
abstractExtensionService.ts:155 Extension host terminated unexpectedly. Code:  null  Signal:  SIGABRT
_onExtensionHostCrashed @ abstractExtensionService.ts:155
notificationsAlerts.ts:40 Der Erweiterungshost wurde unerwartet beendet.
martonsagi commented 4 years ago

Hi, thanks for the details!

I'll check it with above Base App version.

elweilando commented 4 years ago

I have only the 3 default symbols

I can delete .alcache. Directory will be created after starting Object Designer. showStandardEvents is turned off.

Bildschirmfoto 2020-01-07 um 22 38 30
elweilando commented 4 years ago

I was able to reproduce it. In workspace settings "show standard events" was enabled. I overlooked this. After disable "show standard events" it works again.

martonsagi commented 4 years ago

Thanks for the feedback.

I'll remove that option to avoid further confusion. This setting is not required anymore as the new Event List serves its purpose better.

martonsagi commented 4 years ago

Note to self: remove showStandardEvents setting.

pri-kise commented 4 years ago

VS Code did crash too on my system. I think the problem might be caused by several *.app files of the same extension from different tested systems (e.g. 15.3, 16.0, etc.).

After I cleared my .alpackages folder, it still took some time (two seconds), but VS Code didn't crash. Maybe there should be an error thrown if the extension recognizes several .app files of the same extension?

martonsagi commented 4 years ago

Crash is likely due to the too big dataset in this case (duplicated objects from multiple app files). At the moment I filter out the same filenames across multiple projects but version number is not compared within filenames.

v0.1.5 is around the corner but I'll think of some warning to include before the final release.

martonsagi commented 4 years ago

So, my current solution is to pick a version to work with and give a warning at the same time as a reminder to clean up symbol files.

image

martonsagi commented 4 years ago

Note: the average dataset size that is sent to the WebView has been shrinked by ~24%. This should also speed up the loading a bit.

onyangofred commented 2 years ago

Delete the folder ".vscode.alcache"