Issue 121465 - Basic IDE crash observing SdDrawPage
Summary: Basic IDE crash observing SdDrawPage
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows Vista
: P3 Minor
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2012-12-12 13:41 UTC by Risto Jääskeläinen
Modified: 2013-02-24 21:00 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Crash when inspect (90.75 KB, application/
2012-12-12 13:41 UTC, Risto Jääskeläinen
no flags Details
Screenshot inspecting the draw page (82.32 KB, image/png)
2012-12-13 01:15 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Risto Jääskeläinen 2012-12-12 13:41:34 UTC
Created attachment 80018 [details]
Crash when inspect

Here is picture of message:

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.