Bug 1383491 - Optimize memory usage by making object in hash reference small
Summary: Optimize memory usage by making object in hash reference small
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Performance
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.8.0
Assignee: Ladislav Smola
QA Contact: Oleksii Tsuman
URL:
Whiteboard:
Depends On:
Blocks: 1383496 1383497
TreeView+ depends on / blocked
 
Reported: 2016-10-10 18:45 UTC by Satoe Imaishi
Modified: 2017-06-12 17:19 UTC (History)
3 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1383496 1383497 (view as bug list)
Environment:
Last Closed: 2017-06-12 17:19:46 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Satoe Imaishi 2016-10-10 18:45:43 UTC
From PR: https://github.com/ManageIQ/manageiq/pull/11678

The object in the hash reference should be as small as possible,
so we don't need to store that many data in memory.

An object having :id and :type is usable for relation assignment,
which is the only reason we keep this reference.

so now the object stored looks like
h[:_object]

#<ManageIQ::Providers::Amazon::CloudManager::Flavor id: 505, type: "ManageIQ::Providers::Amazon::CloudManager::Flavor">

but with the reload, we are storing

h[:_object].reload
#<ManageIQ::Providers::Amazon::CloudManager::Flavor id: 505, ems_id: 35, name: "t2.nano", description: "T2 Nano", cpus: 1, cpu_cores: 1, memory: 536870912, ems_ref: "t2.nano", type: "ManageIQ::Providers::Amazon::CloudManager::Flavor", supports_32_bit: true, supports_64_bit: true, enabled: true, supports_hvm: true, supports_paravirtual: false, block_storage_based_only: true, cloud_subnet_required: true, ephemeral_disk_size: 0, ephemeral_disk_count: 0, root_disk_size: nil, swap_disk_size: nil, publicly_available: nil>

Comment 4 Oleksii Tsuman 2017-05-05 10:30:06 UTC
verified in 5.8.0.13-rc2.20170502165848_0f98658


Note You need to log in before you can comment on or make changes to this bug.