Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Oracle JRockit: The Definitive Guide
Oracle JRockit: The Definitive Guide

Oracle JRockit: The Definitive Guide: Understanding Adaptive Runtimes using JRockit R27/28

eBook
$31.99 $45.99
Paperback
$76.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Oracle JRockit: The Definitive Guide

Chapter 2. Adaptive Code Generation

This chapter covers code generation and code optimization in a JVM runtime environment, both as a general concept as well as taking a closer look at the JRockit code generation internals. We start by discussing the Java bytecode format, and how a JIT compiler works, making a case for the power of adaptive runtimes. After that, we drill down into the JRockit JVM. Finally, the reader learns how to control code generation and optimization in JRockit.

You will learn the following from this chapter:

  • The benefits of a portable platform-independent language such as Java.

  • The structure of the Java bytecode format and key details of the Java Virtual Machine specification.

  • How the JVM interprets bytecode in order to execute a Java program.

  • Adaptive optimizations at runtime versus static ahead-of-time compilation. Why the former is better but harder to do. The "gambling on performance" metaphor.

  • Why code generation in an adaptive runtime is potentially very powerful.

  • How...

Platform independence


The main selling point for Java when it first came out, and the main contributor to its success as a mainstream language, was the write once/run everywhere concept. Java programs compile into platform-independent, compact Java bytecode (.class files). There is no need to recompile a Java application for different architectures, since all Java programs run on a platform-specific Java Virtual Machine that takes care of the final transition to native code.

This widely enhanced portability is a good thing. An application, such as a C++ program, that compiles to a platform-dependent format, has a lot less flexibility. The C++ compiler may compile and heavily optimize the program, for example for the x86 architecture. Then x86 will be the only architecture on which the program can run. We can't readily move the program, optimizations and all, to SPARC. It has to be recompiled, perhaps by a weaker compiler that doesn't optimize as well as for x86. Also if the x86 architecture...

The Java Virtual Machine


While platform-independent bytecode provides complete portability between different hardware platforms, a physical CPU still can't execute it. The CPU only knows to execute its particular flavor of native code.

Note

Throughout this text, we will refer to code that is specific to a certain hardware architecture as native code. For example, x86 assembly language or x86 machine code is native code for the x86 platform. Machine code should be taken to mean code in binary platform-dependent format. Assembly language should be taken to mean machine code in human-readable form.

Thus, the JVM is required to turn the bytecodes into native code for the CPU on which the Java application executes. This can be done in one of the following two ways (or a combination of both):

  • The Java Virtual Machine specification fully describes the JVM as a state machine, so there is no need to actually translate bytecode to native code. The JVM can emulate the entire execution state of the Java...

Code generation strategies


There are several ways of executing bytecode in a JVM, from just emulating the bytecode in a pure bytecode interpreter to converting everything to native code for a particular platform.

Pure bytecode interpretation

Early JVMs contained only simple bytecode interpreters as a means of executing Java code. To simplify this a little, a bytecode interpreter is just a main function with a large switch construct on the possible opcodes. The function is called with a state representing the contents of the Java evaluation stack and the local variables. Interpreting a bytecode operation uses this state as input and output. All in all, the fundamentals of a working interpreter shouldn't amount to more than a couple of thousand lines of code.

There are several simplicity benefits to using a pure interpreter. The code generator of an interpreting JVM just needs to be recompiled to support a new hardware architecture. No new native compiler needs to be written. Also, a native...

Adaptive code generation


Java is dynamic in nature and certain code generation strategies fit less well than others. From the earlier discussion, the following conclusions can be drawn:

  • Code generation should be done at runtime, not ahead of time.

  • All methods cannot be treated equally by code generator. There needs to be a way to discern a hot method from a cold one. Otherwise unnecessary optimization effort is spent on cold methods, or worse, not enough optimization effort on hot methods.

  • In a JIT compiler, bookkeeping needs to be in place in order to keep up with the adaptive runtime. This is because generated native code invalidated by changes to the running program must be thrown away and potentially regenerated.

Achieving code execution efficiency in an adaptive runtime, no matter what JIT or interpretation strategy it uses, all boils down to the equation:

Total Execution Time = Code Generation Time + Execution Time

In other words, if we spend lots of effort carefully generating and optimizing...

Inside the JIT compiler


While it is one thing to compile bytecodes to native code and have it executed within the JVM, getting it to run as efficiently as possible is a different story. This is where 40 years of research into compilers is useful, along with some insight into the Java language. This section discusses how a JIT compiler can turn bytecode into efficient native code.

Working with bytecode

A compiler for a programming language typically starts out with source code, such as C++. A Java JIT compiler, in a JVM, is different in the way that it has to start out with Java bytecode, parts of which are quite low level and assembly-like. The JIT compiler frontend, similar to a C++ compiler frontend, can be reused on all architectures, as it's all about tokenizing and understanding a format that is platform-independent—bytecode.

While compiled bytecode may sound low level, it is still a well-defined format that keeps its code (operations) and data (operands and constant pool entries) strictly...

The JRockit code pipeline


Given that the frontend of the JIT compiler is finished with the bytecode, having turned it into some other form that is easier to process, what happens next? Typically, the code goes through several levels of transformations and optimizations, each level becoming increasingly platform-dependent. The final level of code is native code for a particular platform. The native code is emitted into a code buffer and executed whenever the function it represents is called.

Naturally, it makes sense to keep the JIT compiler portable as far as possible. So, most optimizations are usually done when the intermediate code format is still platform-independent. This makes it easier to port the JIT compiler to different architectures. However, low-level, platform-specific optimizations must naturally be implemented as well to achieve industrial strength performance.

This section describes how the JIT compiler gets from bytecode to native code and the stages involved. We concentrate...

Controlling code generation in JRockit


JRockit is designed to work well out of the box, and it is generally discouraged to play around too much with its command-line options. Changing the behavior of code generation and optimization is no exception. This section exists mostly for informational purposes and the user should be aware of possible unwanted side effects that can arise from changing the behavior of the code generators.

Note

This section applies mainly to the versions of JRockit from R28 and later. For earlier versions of JRockit, please consult the JRockit documentation for equivalent ways of doing the same thing. Note that all R28 functionality does not have equivalents in earlier versions of JRockit.

Command-line flags and directive files

In the rare case that the code generator causes problems in JRockit, or an application behaves strangely or erroneously, or it just takes too long time to optimize a particular method, the JRockit code generator behavior can be altered and controlled...

Summary


This chapter discussed code generation in a runtime environment. The topic was introduced as a general problem, comparing adaptive compilation to static compilation. We also explained special situations that apply to code generation in a Java Virtual Machine.

We have discussed some aspects of the Java bytecode format, its pros and cons, and the challenges of making Java code run fast, using different techniques from interpretation to total JIT compilation.

Furthermore, we have discussed the challenges of an adaptive runtime, where new code can enter the system at any time, and how to overcome them by "educated guesses", or "gambling". This means that JVM takes the optimistic approach when optimizing that made assumptions rarely change. We also mentioned the equation compilation speed versus execution speed, depending on method "hotness".

Finally, the chapter introduced the code pipeline in the JRockit Virtual Machine and its state of the art optimizations, using a comprehensive example...

Left arrow icon Right arrow icon

Key benefits

  • Learn about the fundamental building blocks of a JVM, such as code generation and memory management, and utilize this knowledge to develop code you can count on
  • Realize the full potential of Java applications by learning how to apply advanced tuning and analysis
  • Work with the JRockit Mission Control 3.1/4.0 tools suite to debug or profile your Java applications
  • Learn the simplicity and performance benefits of virtualizing Java through JRockit Virtual Edition
  • Written by Marcus Hirt and Marcus Lagergren, founder members of Appeal Virtual Machines, the company that created the Java Virtual Machine: JRockit

Description

Oracle JRockit is one of the industry’s highest performing Java Virtual Machines. Java developers are always on the lookout for better ways to analyze application behavior and gain performance. As we all know, this is not as easy as it looks. Welcome to JRockit: The Definitive Guide.This book helps you gain in-depth knowledge of Java from the JVM’s point of view. We will explain how to write code that works well with the JVM to gain performance and scalability. Starting with the inner workings of the JRockit JVM and finishing with a thorough walkthrough of the tools in the JRockit Mission Control suite, this book is for anyone who wants to know more about how the JVM executes your Java application and how to profile for better performance.

Who is this book for?

This book is for intermediate to advanced Java Developers, who want to monitor, diagnose, profile and enhance the performance of their Java applications. It is also for people who want to understand more about the internal workings of a modern Java Virtual Machine or adaptive runtime. Parts of the book are suitable as course material for education about runtimes.

What you will learn

  • Get to grips with the fundamental building blocks of a JVM: the code generator, the garbage collector, and the implementation of threads and synchronization. Learn the design philosophy behind the JRockit JVM in these areas.
  • Become a better Java programmer through enhanced understanding of the Java runtime.
  • Learn how program execution works in an adaptive environment.
  • Create relevant benchmarks and accurately measure the performance of your Java application.
  • Learn the most important command-line flags that control JRockit subsystems and their use for performance tuning.
  • Get to know what JRockit Mission Control is, how to set it up, and how to trouble-shoot it.
  • Use the JRockit Management Console to monitor and manage a running JRockit instance.
  • Profile your JRockit JVM and Java application with near zero overhead using the JRockit Runtime Analyzer and the JRockit Flight Recorder.
  • Detect and resolve Java memory leaks using the JRockit Memory Leak Detector tool.
  • Learn how JRockit Virtual Edition works and why it outperforms other Java solutions in traditional virtualized environments.
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 01, 2010
Length: 588 pages
Edition : 1st
Language : English
ISBN-13 : 9781847198068
Vendor :
Oracle
Category :
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Jun 01, 2010
Length: 588 pages
Edition : 1st
Language : English
ISBN-13 : 9781847198068
Vendor :
Oracle
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $56.98 $82.98 $26.00 saved
Getting Started with Oracle WebLogic Server 12c: Developer's Guide
$60.99
Oracle JRockit: The Definitive Guide
$76.99
Total $56.98$82.98 $26.00 saved Stars icon

Table of Contents

13 Chapters
Getting Started Chevron down icon Chevron up icon
Adaptive Code Generation Chevron down icon Chevron up icon
Adaptive Memory Management Chevron down icon Chevron up icon
Threads and Synchronization Chevron down icon Chevron up icon
Benchmarking and Tuning Chevron down icon Chevron up icon
JRockit Mission Control Chevron down icon Chevron up icon
The Management Console Chevron down icon Chevron up icon
The Runtime Analyzer Chevron down icon Chevron up icon
The Flight Recorder Chevron down icon Chevron up icon
The Memory Leak Detector Chevron down icon Chevron up icon
JRCMD Chevron down icon Chevron up icon
Using the JRockit Management APIs Chevron down icon Chevron up icon
JRockit Virtual Edition Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(10 Ratings)
5 star 80%
4 star 20%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Alexey Shurygin Oct 28, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Love it. Not so many books out there about JVM development. This is one of a few and an excellent one. Thanks Marcus!
Amazon Verified review Amazon
Norman Maurer Sep 24, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you ever wanted to know what is going on behind the scenes of the JVM, this book is your best bet. I highly recommend it to everyone who wants to do serious programming of high-performance applications on the JVM. For me it's one of the most important books in my book shelf. The authors are well known for their knowledge in this area and make it easy to gasp the ideas while reading it. It contains many informations which includes (to only name a few) JIT optimizations, GC, Allocations, Memory management, best practices and known pitfalls.Don't get confused by the name of the book, most of the informations inside apply to other JVM implementations as well. Now that most of the "original" code of JRockit is part of openjdk / oracle jdk it's even more spot on then before. As Mission Control was just released as part of oracle jdk7u40 the contained chapters in the book that covers the "JRockit Mission Control" are a nice addition to the docs out there.So to make it short, if you are looking for something that explains the JVM in detail this book is the one to buy right away.
Amazon Verified review Amazon
Noora Peura Aug 09, 2010
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have been involved in developing both the JRockit JVM and JRockit Mission Control for nine years and I am thus very familiar with the subject of this book. I already knew that the authors are brilliant engineers who know what they are talking about. This book also shows that they can talk about it well. Marcus and Marcus have managed to condense years of research and development into one book and translate it to "human readable" format. This book takes you under the hood and behind the scenes of JRockit. It digs deep and goes personal, explaining not only how the JVM works but also why.This is a book for Java developers who take their craft seriously and want to open the black box beneath them and make friends with the mystical creature that resides inside. This is a book for Java administrators who want hands-on tips on how to make their life easier and their applications run better and faster. This is a book for the computer science geek who simply needs to know how all the magic is done.The first part of the book opens up the JVM, pulls out the parts and puts them on display. These chapters describe code generation, memory management, threads and locks, both in general and in the specific example of the JRockit JVM. This is more than a whitepaper on JRockit internals, this is a complete schoolbook in JVMs. With each chapter you also get pointers for what to do and especially what not to do in order to work with the black box rather than against it.After a chapter on benchmarking and tuning comes the probably most comprehensive guide available to the JRockit tools - JRockit Mission Control and JRCMD. Plenty of screenshots and example outputs take you through the tools, how to use them and even how to extend them.The last chapter introduces JRockit Virtual Edition that takes the JVM closer to the hardware by eliminating the operating system. It also takes a look at where JVM development may be heading in the future.Personally, I especially enjoyed reading the history of the JRockit JVM, and the authors' own comments on Java and software development. These are the details that take the book beyond a technical description of JRockit and help you understand the design choices behind this complex piece of technology.
Amazon Verified review Amazon
M. Eisele Nov 23, 2010
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This one was on my list of things to buy for quite some time. The only reason for this is simple: Oracle JRockit is one of the industry's highest performing Java Virtual Machines and I loved it's JIT everything approach since the beginning. I did not manage to do this, since it was published. But a few days ago, the digital edition arrived on my iPad and I finally found the time to read it. Sit back and relax. This is my personal view about the most stunning Java related book of 2010!The AuthorsAs usual, I start with a short introduction of the authors. In this special case, I feel this is very important to understand the book. Both started out with Appeal Virtual Machines where they were founders. This was the company, which initially developed JRockit. Marcus Lagergren holds a M.Sc. in computer science from the Royal Institute of Technology in Stockholm, Sweden. He has a background in computer security but has worked with runtimes since 1999. Marcus has been team lead and architect for the JRockit code generators and has been involved in pretty much every other aspect of the JRockit JVM internals. Since 2007 Marcus works for Oracle on fast Virtualization technology.Marcus Hirt is currently working for Oracle as Team Lead, Engineering Manager and Architect for the JRockit Mission Control team. Marcus has been an appreciated speaker on Oracle Open World, eWorld, BEAWorld, EclipseCon, Nordev and Expert Zone Developer Summit, and has contributed JRockit related articles and webinars to the JRockit community. Marcus Hirt got his M.Sc. education in computer science from the Royal Institute of Technology in Stockholm.The ContentJava developers are always on the lookout for better ways to analyze application behavior and gain performance. As we all know, this is not as easy as it looks. If you are trying to understand more about all this you need to know far more than simple Java. The big things in terms of performance happen elsewhere: In the JVM. If you are looking for the best Server JVM out there, you'll come across JRockit. And this book is there to reveal it's secrets. This book helps you gain in-depth knowledge of Java from the JVM's point of view. It explains how to write code that works well with the JVM to gain performance and scalability.The first chapter get's you started. You learn about the real basics. Cmd-line options and JRockit versioning. The real content starts with chapter 2. It brings you down to the inner workings of the JVM and the adaptive code generation ürinciples. If you are not used to assembly code examples, you will learn it. Examples are explained with bytecode and assemly code. If necessary instruction by instruction. Further on, code generation strategies, JIT compiling and runtime optimizations are explained as concepts with additional JRockit details. Chapter 3 takes you over to adaptive memory management. Here you will learn about the basics of heap management and garbage collection algorithms. Also scaling and performance are touched here. You get a glimpse at pitfalls and things, that will not work. Chapter 4 follows with everything about threads and synchronization and topics that are hard to debug and difficult to optimize. You get a more detailed look at special JRockit flags which help optimizing the topic. Chapter 5 gives your everything about benchmarking and tuning. You get basic hints about what to think about while creating a benchmark and about which measures to take. It also contains a brief overview about industry-standard benchmarks. After that you get to know about common bottlenecks and how to avoid them. Chapter 6 presents an overview about the JRockit Mission Control. Followed by chapter 7 which dives into the management console, touching MBeans, the runtime and further topics. The runtime analyzer is detailed in chapter 8. Learn about the recordings and how to analyze them in terms of memory, code, threads/locks and latency findings. As expected the flight recorder follows in chapter 9. Another JRockit tool, the memory leak detector is the major player in chapter 10. Chapter 11 dives into the JRCMD cmd-line utility and shows how it can be used for listing and sending diagnostic cmds to one or more locally running instance of the JVM. It's an alphabetical reference guide to the JRCMD commands. Chapter 12 contains everything you need to know about using the JRockit management APIs by showcasing examples. The last chapter 13 summarizes the basics about the JRockit Virtual Edition and gives some basics about the challenges by virtualizing Java. If needed you can dive deeper with the bibliography or even look through the glossary or index. 477 pages of content without the preface and the appendix is a big hit for your weekend. You better have some very silent times to follow this stuff!Writing and styleAs you might have guessed already: I am impressed by the book. Being used to read complex and detailed stuff which takes time, I really flew through this book. You get used to the direct and technical style very easy and it's still personal enough to be interesting so you keep on reading page after page. Even non native speakers should be able to follow, if they know the technical terms. I needed to lookup some very uncommon and hardware near things but this did not disturb the overall reading experience.This was my fist eBook as PDF from Packt Publishing and I am not sure, if I am still willing to have the printed version, too. The many assembly and other code examples always makes you want to scroll back. If you are using a book you just need your thumb to solve this problem :) But I still like the digital reading experience in general.My expectationsThe structure is a bit different from the one I expected. The tooling around JRockit is covered a lot; something I wasn't expecting. But this is the only part, that did not fulfill my expectations. Especially because even those parts are excellent.I expected to read some very technical content. But it was far more than that. It goes down to the metal and handles and registers and the JVM internals. If you thought, you know anything about the inner workings of a JVM ... here is what really happens. Don't ask what you can do for your JVM; ask, what your JVM can do for you :)Conclusion and recommendationBuy one! No .. better two! The digital edition and of course the paperback. It's worth it. If you have both, you can always carry the digital edition around and recall the basics and optimizations to yourself every time you think about writing optimized code for the JVM. Make shure, you have a silent place to read this one. And you should get a recent JRockit R28 to play around with. I wrote articles about it and I have seen it in the wild since some time. I thought I know a bit. Now, I know even more!If you are a beginner, you probably need some more basics before reading this one.
Amazon Verified review Amazon
GR Feb 08, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As a technical performance tester this book was great in understanding more about JVMs (in particular JRockit!), well written and easy to read.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela