Issue 121465

Summary: Basic IDE crash observing SdDrawPage
Product: App Dev Reporter: Risto Jääskeläinen <rjaaskel>
Component: scriptingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Minor    
Priority: P3 CC: issues, marcelly.bernard
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Crash when inspect
none
Screenshot inspecting the draw page none

Description Risto Jääskeläinen 2012-12-12 13:41:34 UTC
Created attachment 80018 [details]
Crash when inspect

Here is picture of message:
http://www.saunalahti.fi/~rjaaskel/Kuvat/DrawBasicvirhe.gif

I was creating some Basic script animation on Draw document and inspecting objects when AOO crash. It seems that Basic IDE is using lot of memory in this inspecting mode because there is no crash or memory robbery when I just run Basic macro.  And if I remove few objects from document I can some time inspect without crash. I don't find any specific object to remove but when just most of complicated objects (or pages) was removed it seems that my 4 GB memory was enought.  Still file size of Draw document Kerroskokeilutonttuinen.odg is only 45 kB. Maybe I can attach it.

So I suppose that Basic IDE has some old inefficiency in it's memory managing.
Comment 1 Ariel Constenla-Haile 2012-12-13 01:15:02 UTC
Created attachment 80021 [details]
Screenshot inspecting the draw page

I couldn't make it crash, because my PC has a lot of memory, but it took a lot of memory and time to expand the tree. The reason seams to be that the IDE inspects every property of the original object, in its first level.

There you can see that Preview and PreviewBitmap are two arrays containing 32719 integers, each one. This seems to be the reason of the huge amount of memory consumed.

May be the IDE shouldn't load the whole array. Some IDEs display arrays on demand, for example the first 20 elements only, and on demand (clicking the last element indicated with a "...", for example) the next 20.
Comment 2 bmarcelly 2012-12-17 14:06:37 UTC
The Basic IDE inspector shows a wrong dimension.

In fact, using Xray, Preview is displayed as :
   Table : T(0 to 10502927 ) As Integer
That is : more than 10 millions elements.

When Xray tries to display the contents of the array, memory consumptions increases of 1150 Mbytes.
This is in line with the real consumption of arrays in Basic : about 100 bytes per element. 

I think the problem is a limitation of inspectors in such extreme situations, due to internal design of Basic or the API. You have to load the data in order to find out it is an array and what are its dimensions.

The image is probably stored as uncompressed graphic data, this is not efficient.