Why HeapBitmap.base pointer is alignment 4 KB?

by nari » Fri, 24 Jul 2009 12:32:52 GMT

Sponsored Links

I read GC of dalvikVM.
I had one question on the BitmapMarking.

--- start ---
/* file is dalvik/vm/alloc/HeapSource.c: addNewHeap() */
321:  static bool
322:  addNewHeap(HeapSource *hs, mspace *msp, size_t
323:  {

/* snip */

355:      if (!dvmHeapBitmapInit(&heap.objectBitmap,
356:                             (void *)ALIGN_DOWN_TO_PAGE_SIZE
357:                             heap.absoluteMaxSize,
358:                             "objects"))
--- end ---

Why used ALIGN_DOWN_TO_PAGE_SIZE()? (at 356line)
Anybody knows who would be the best person can answer about the

I thought overnight, but I did not understand it. :(

Narihiro Nakamura


Other Threads

1. Notification Manager Help

Just trying to create a simple notification, but keep getting an
illegalarguementexception "contentIntent required". Which is weird
because I believe I am passing the content intent.  Here is my code...

                notification = new Notification(iconID, message,
                PendingIntent appIntent = PendingIntent.getActivity(mobileApp, 
new Intent(), PendingIntent.FLAG_NO_CREATE);
                notification.setLatestEventInfo(mobileApp,"Now Playing: ",
detailedMessaged, appIntent);
                nManager.notify(MOBILE_APP_ID, notification );
                Log.d( this.getClass().toString(), "Launching New Notification" 

I dont even care if the notification does anything when u click on it.
I just want a notification the user can see. I construct an empty
intent "new Intent()", but have also tried it with a non-empty intent.
I also tried passing null for contentIntent, and get the same
exception. Whats the deal-o? Thanks for any help

2. how to find out the percentage of memory used by each process in the android

There is lots of memory sharing between processes, so this is actually a
really hard thing to determine.  For development purposes, the "procrank"
command is the most common tool to use.  The last two columns of memory
usage are the most interesting ones: the last one is the memory owned
exclusively by that process, and the second to the last is that plus the
shared memory weighted by how many processes are sharing each page.

Note that this command is not part of the SDK, and for format of its output
tends to change, so it should only be used for development purposes.

For even more detail specifically about Java processes, you can use "adb
shell dumpsys memoryinfo"

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


3. Best Practice for overriding both Theme and Theme.Dialog correctly in an app?

4. Fwd: Toast

5. Keyboard Backlight (G1) unavailable in Cupcake 1.5

6. how to obfuscate Android code during eclipse compile

7. Cell Radio Info