IP Library Granted Patent US 9,665,394
Granted Patent B2
US 9,665,394 · App. 14/221,812 · Granted May 30, 2017

Sharing application objects among multiple tenants

Inventors: Snehal S. Antani (Hyde Park, NY); Junjie Cai (Cary, NC); Jia Fei (Shanghai, CN); Wei Wei Gao (Shanghai, CN); Heng Wang (Shanghai, CN); Yan R. Wu (Shanghai, CN)
Assignee: International Business Machines Corporation
G06F9/468
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,665,394
App. No.
14/221,812
Filed
Mar 21, 2014
Granted
May 30, 2017
Kind
B2
Art Unit
2457
USPC
709/204
Abstract

The present invention discloses a method and system for sharing application objects among multiple tenants, wherein the method comprises: identifying objects that can be shared by multiple tenants; merging the objects that can be shared by the multiple tenants; and updating references of the tenants to the shared objects prior to the merging so as to cause the references to point at a merged shared object. The method of the present invention enables the tenants to share application data more efficiently.

Claims (57)

1. A method for sharing objects among multiple tenants, wherein the objects are application objects, and wherein the method comprises:

identifying, by one or more processors, objects that can be shared by the multiple tenants;

merging, by one or more processors, the objects that can be shared by the multiple tenants, wherein said merging the objects that can be shared by the multiple tenants comprises:

merging, by one or more processors, primitive-like type fields in the objects that can be shared by the multiple tenants;

comparing, by one or more processors, complex reference type fields in the objects that can be shared by the multiple tenants;

in response to the complex reference type fields in the objects that can be shared by the multiple tenants pointing at different addresses, marking, by one or more processors, the complex reference type fields in the objects that can be shared by the multiple tenants as field values being only visible within tenant domains to which original objects comprising the fields belong;

updating, by one or more processors, references of tenants to the shared objects prior to the merging so as to cause the references to point at a merged shared object;

in response to a tenant modifying multiple fields of the merged shared object, copying, by one or more processors, a new object based on the merged shared object;

updating, by one or more processors, values of multiple fields of the copied object; and

modifying, by one or more processors, the reference of the tenant pointing at the merged shared object to be pointing at the copied object.

2. The method according to claim 1 , wherein the objects that can be shared by the multiple tenants are objects belonging to a same class and whose primitive-like type fields have identical contents but belong to different tenants.

3. The method according to claim 2 , further comprising:

filtering out, by one or more processors, candidate objects that can be shared by the multiple tenants from among heap objects of a Java virtual machine.

4. The method according to claim 2 , wherein the primitive-like type fields comprise at least one of a group consisting of: primitive data, an array of the primitive data, a package class of the primitive data, an array of package classes, and an invariable object.

5. The method according to claim 3 , wherein said identifying objects that can be shared by the multiple tenants comprises:

grouping, by one or more processors, the candidate objects according to the tenants to which the candidate objects belong; and

identifying, by one or more processors, the objects that can be shared by the multiple tenants from among different candidate object groups.

6. The method according to claim 3 , wherein the candidate objects that can be shared by the multiple tenants are objects that have experienced a predetermined length of time and are composed of the primitive-like type fields, wherein the primitive-like type fields were not modified within the predetermined length of time.

7. The method according to claim 5 , wherein said identifying objects that can be shared by the multiple tenants comprises:

comparing, by one or more processors, classes to which the objects in the different candidate object groups belong and values of their primitive-like type fields to determine whether the belonged classes and the values of the primitive-like type fields are identical; and

in response to the belonged classes and the values of the primitive-like type fields being identical, determining, by one or more processors, that these objects are the objects that can be shared by the multiple tenants.

8. The method according to claim 5 , wherein said identifying objects that can be shared by the multiple tenants comprises:

comparing, by one or more processors, hash values of the objects in the different candidate object groups, wherein the hash values are obtained from calculation based on the classes to which the objects belong and the values of all primitive-like type fields, and are pre-stored in an object structure; and

in response to the hash values of the objects in the different candidate object groups being identical, determining, by one or more processors, that these objects are the objects that can be shared by the multiple tenants.

9. A system for sharing objects among multiple tenants, wherein the objects are application objects, and wherein the system comprises:

an identifying hardware device configured to identify objects that can be shared by the multiple tenants;

a first merging hardware device configured to merge the objects that can be shared by the multiple tenants, wherein the first merging hardware device comprises:

a second merging hardware device configured to merge primitive-like type fields in the objects that can be shared by the multiple tenants;

a first comparing hardware device configured to compare complex reference type fields in the objects that can be shared by the multiple tenants; and

a third merging hardware device configured to, in response to the complex reference type fields in the objects that can be shared by the multiple tenants pointing at different addresses, mark the complex reference type fields in the objects that can be shared by the multiple tenants as field values being only visible within tenant domains to which original objects comprising the fields belong;

a reference updating hardware device configured to update references of tenants to the shared objects prior to the merging so as to cause the references to point at a merged shared object;

a copying hardware device configured to, in response to a tenant modifying multiple fields of the merged shared object, copy a new object based on the merged shared object;

an updating hardware device configured to update values of multiple fields of the copied object; and

a reference modifying hardware device configured to modify the reference of the tenant pointing at the merged shared object to be pointing at the copied object.

10. The system according to claim 9 , wherein the objects that can be shared by the multiple tenants are objects belonging to a same class and whose primitive-like type fields have identical contents but belonging to different tenants, and wherein the primitive-like type fields comprise at least one of a group consisting of: primitive data, an array of the primitive data, a package class of the primitive data, an array of package classes, and an invariable object.

11. The system according to claim 10 , further comprising:

a filtering hardware system configured to filter out candidate objects that can be shared by the multiple tenants from among heap objects of a Java virtual machine.

12. The system according to claim 11 , wherein the identifying device comprises:

a grouping hardware device configured to group the candidate objects according to the tenants to which the candidate objects belong; and

a group identifying hardware device configured to identify the objects that can be shared by the multiple tenants from among different candidate object groups.

13. The system according to claim 11 , wherein the candidate objects that can be shared by the multiple tenants are objects that have experienced a sufficiently long time and are mainly composed of the primitive-like type fields, wherein the primitive-like type fields were not modified within the sufficiently long time.

14. The system according to claim 12 , wherein the identifying hardware device comprises:

a second comparing hardware device configured to compare classes to which the objects in the different candidate object groups belong and values of their primitive-like type fields to determine whether the belonged classes and the values of the primitive-like type fields are identical; and

a determining hardware device configured to, in response to the belonged classes and the values of the primitive-like type fields being identical, determine that these objects are the objects that can be shared by the multiple tenants.

15. The system according to claim 12 , wherein the identifying hardware device comprises:

a second comparing hardware device configured to compare hash values of the objects in the different candidate object groups, wherein the hash values are obtained from calculation based on the classes to which the objects belong and the values of all primitive-like type fields, and are pre-stored in an object structure; and

a determining hardware device configured to, in response to the hash values of the objects in the different candidate object groups being identical, determine that these objects are the objects that can be shared by the multiple tenants.

16. A computer program product for sharing objects among multiple tenants, wherein the objects are application objects, and wherein the computer program product comprises a non-transitory computer readable storage medium having program code embodied therewith, the program code readable and executable by a processor to perform a method comprising:

identifying objects that can be shared by the multiple tenants;

merging the objects that can be shared by the multiple tenants, wherein said merging the objects that can be shared by the multiple tenants comprises:

merging primitive-like type fields in the objects that can be shared by the multiple tenants;

comparing complex reference type fields in the objects that can be shared by the multiple tenants;

in response to the complex reference type fields in the objects that can be shared by the multiple tenants pointing at different addresses, marking, by one or more processors, the complex reference type fields in the objects that can be shared by the multiple tenants as field values being only visible within tenant domains to which original objects comprising the fields belong;

updating references of tenants to the shared objects prior to the merging so as to cause the references to point at a merged shared object;

in response to a tenant modifying multiple fields of the merged shared object, copying a new object based on the merged shared object;

updating values of multiple fields of the copied object; and

modifying the reference of the tenant pointing at the merged shared object to be pointing at the copied object.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 21, 2014
From: ANTANI, SNEHAL S.; CAI, JUNJIE; FEI, JIA; GAO, WEI WEI; WANG, HENG; WU, YAN R.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 032498/0101 →
Priority Claims (1)
CN 2013 1 0108987 · Mar 29, 2013 · national
Continuity (1)
Related Publication 20140297751A1 · Oct 2, 2014